pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:103:   static char trace_buffer[2000];   #endif      #ifdef INTERNAL_PROFILING   PMOD_EXPORT unsigned long evaluator_callback_calls = 0;   #endif         int fast_check_threads_counter = 0;    + /* This is used for strapping the interpreter before the threads +  * are loaded, and when there's no support for threads. +  */ + static struct Pike_interpreter_struct static_pike_interpreter; +    /* Pike_sp points to first unused value on stack    * (much simpler than letting it point at the last used value.)    */ - PMOD_EXPORT struct Pike_interpreter Pike_interpreter; + PMOD_EXPORT struct Pike_interpreter_struct *Pike_interpreter_pointer = +  &static_pike_interpreter;   PMOD_EXPORT int Pike_stack_size = EVALUATOR_STACK_SIZE;      static void do_trace_call(INT32 args, dynamic_buffer *old_buf);   static void do_trace_func_return (int got_retval, struct object *o, int fun);   static void do_trace_return (int got_retval, dynamic_buffer *old_buf);         void push_sp_mark(void)   {    if(Pike_mark_sp == Pike_interpreter.mark_stack + Pike_stack_size)
pike.git/src/interpret.c:185:    * Returns 0 if pc is NULL.    *    * Returns -1 if the code terminated due to a RETURN.    *    * Note: All callers except catching_eval_instruction need to save    * Pike_interpreter.catching_eval_jmpbuf, zero it, and restore it    * afterwards.    */   static int eval_instruction(PIKE_OPCODE_T *pc);    - PMOD_EXPORT int low_init_interpreter(struct Pike_interpreter *interpreter) + PMOD_EXPORT int low_init_interpreter(struct Pike_interpreter_struct *interpreter)   {   #ifdef USE_MMAP_FOR_STACK    static int fd = -1;      #ifndef MAP_VARIABLE   #define MAP_VARIABLE 0   #endif      #ifndef MAP_PRIVATE   #define MAP_PRIVATE 0
pike.git/src/interpret.c:284: Inside #if defined(PROFILING)
  #ifdef PROFILING    interpreter->unlocked_time = 0;    interpreter->accounted_time = 0;   #endif       return 0; /* OK. */   }      PMOD_EXPORT void init_interpreter(void)   { -  if (low_init_interpreter(&Pike_interpreter)) { +  if (low_init_interpreter(Pike_interpreter_pointer)) {    Pike_fatal("Out of memory initializing the interpreter stack.\n");    }      #ifdef PIKE_DEBUG    {    static struct callback *spcb;    if(!spcb)    {    spcb=add_gc_callback(gc_check_stack_callback,0,0);    dmalloc_accept_leak(spcb);
pike.git/src/interpret.c:3028: Inside #if defined(PIKE_DEBUG)
  {    struct pike_frame *f, *of;      #ifdef PIKE_THREADS    extern struct thread_state *gdb_thread_state_for_id(THREAD_T);    struct thread_state *ts = gdb_thread_state_for_id(thread_id);    if (!ts) {    fputs ("Not a Pike thread.\n", stderr);    return;    } -  if (ts->swapped) +     f = ts->state.frame_pointer; -  else -  f = Pike_fp; +    #else    f = Pike_fp;   #endif       for (of = 0; f; f = (of = f)->next)    if (f->refs) {    int args, i;    char *file = NULL;    INT32 line;   
pike.git/src/interpret.c:3238:      PMOD_EXPORT void custom_check_stack(ptrdiff_t amount, const char *fmt, ...)   {    if (low_stack_check(amount)) {    va_list args;    va_start(args, fmt);    va_error(fmt, args);    }   }    - PMOD_EXPORT void low_cleanup_interpret(struct Pike_interpreter *interpreter) + PMOD_EXPORT void low_cleanup_interpret(struct Pike_interpreter_struct *interpreter)   {   #ifdef USE_MMAP_FOR_STACK    if(!interpreter->evaluator_stack_malloced)    {    munmap((char *)interpreter->evaluator_stack,    Pike_stack_size*sizeof(struct svalue));    interpreter->evaluator_stack = 0;    }    if(!interpreter->mark_stack_malloced)    {