pike.git / src / main.c

version» Context lines:

pike.git/src/main.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: main.c,v 1.92 2000/07/06 00:30:32 hubbe Exp $"); + RCSID("$Id: main.c,v 1.93 2000/07/07 01:47:05 hubbe Exp $");   #include "fdlib.h"   #include "backend.h"   #include "module.h"   #include "object.h"   #include "language.h"   #include "lex.h"   #include "pike_types.h"   #include "builtin_functions.h"   #include "array.h"   #include "stralloc.h"
pike.git/src/main.c:390:    }    }else{    break;    }    }      #if !defined(RLIMIT_NOFILE) && defined(RLIMIT_OFILE)   #define RLIMIT_NOFILE RLIMIT_OFILE   #endif    -  stack_top = (char *)&argv; +  Pike_interpreter.stack_top = (char *)&argv;       /* Adjust for anything already pushed on the stack.    * We align on a 64 KB boundary.    * Thus we at worst, lose 64 KB stack.    *    * We have to do it this way since some compilers don't like    * & and | on pointers, and casting to an integer type is    * too unsafe (consider 64-bit systems).    */   #if STACK_DIRECTION < 0    /* Equvivalent with |= 0xffff */ -  stack_top += (~((unsigned long)stack_top)) & 0xffff; +  Pike_interpreter.stack_top += (~((unsigned long)Pike_interpreter.stack_top)) & 0xffff;   #else /* STACK_DIRECTION >= 0 */    /* Equvivalent with &= ~0xffff */ -  stack_top -= ( ((unsigned long)stack_top)) & 0xffff; +  Pike_interpreter.stack_top -= ( ((unsigned long)Pike_interpreter.stack_top)) & 0xffff;   #endif /* STACK_DIRECTION < 0 */      #if defined(HAVE_GETRLIMIT) && defined(RLIMIT_STACK)    {    struct rlimit lim;    if(!getrlimit(RLIMIT_STACK, &lim))    {   #ifdef RLIM_INFINITY    if(lim.rlim_cur == RLIM_INFINITY)    lim.rlim_cur=1024*1024*32;   #endif      #ifdef Pike_INITIAL_STACK_SIZE    if(lim.rlim_cur > Pike_INITIAL_STACK_SIZE)    lim.rlim_cur=Pike_INITIAL_STACK_SIZE;   #endif    -  stack_top += STACK_DIRECTION * lim.rlim_cur; +  Pike_interpreter.stack_top += STACK_DIRECTION * lim.rlim_cur;      #ifdef HAVE_PTHREAD_INITIAL_THREAD_BOS   #if defined(HAVE_DLOPEN) && defined(HAVE_DLFCN_H)    /* FIXME: this code should be used on all linux glibc systems    * even those without __pthread_initial_thread_bos    * -Hubbe    */    {    char ** bos_location;    void *handle;
pike.git/src/main.c:453: Inside #if defined(HAVE_GETRLIMIT) && defined(RLIMIT_STACK) and #if defined(HAVE_PTHREAD_INITIAL_THREAD_BOS)
   }   #else       {    extern char * __pthread_initial_thread_bos;    /* Linux glibc threads are limited to a 4 Mb stack    * __pthread_initial_thread_bos is the actual limit    */       if(__pthread_initial_thread_bos && -  (__pthread_initial_thread_bos - stack_top) *STACK_DIRECTION < 0) -  stack_top=__pthread_initial_thread_bos; +  (__pthread_initial_thread_bos - Pike_interpreter.stack_top) *STACK_DIRECTION < 0) +  Pike_interpreter.stack_top=__pthread_initial_thread_bos;    }   #endif   #endif -  stack_top -= STACK_DIRECTION * 8192 * sizeof(char *); +  Pike_interpreter.stack_top -= STACK_DIRECTION * 8192 * sizeof(char *);      #ifdef STACK_DEBUG    fprintf(stderr, "1: C-stack: 0x%08p - 0x%08p, direction:%d\n", -  &argv, stack_top, STACK_DIRECTION); +  &argv, Pike_interpreter.stack_top, STACK_DIRECTION);   #endif /* STACK_DEBUG */    }    }   #else /* !HAVE_GETRLIMIT || !RLIMIT_STACK */    /* 128 MB seems a bit extreme, most OS's seem to have their limit at ~8MB */ -  stack_top += STACK_DIRECTION * (1024*1024 * 8 - 8192 * sizeof(char *)); +  Pike_interpreter.stack_top += STACK_DIRECTION * (1024*1024 * 8 - 8192 * sizeof(char *));   #ifdef STACK_DEBUG    fprintf(stderr, "2: C-stack: 0x%08p - 0x%08p, direction:%d\n", -  &argv, stack_top, STACK_DIRECTION); +  &argv, Pike_interpreter.stack_top, STACK_DIRECTION);   #endif /* STACK_DEBUG */   #endif /* HAVE_GETRLIMIT && RLIMIT_STACK */      #if 0   #if defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE)    {    struct rlimit lim;    long tmp;    if(!getrlimit(RLIMIT_NOFILE, &lim))    {