pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: interpret.c,v 1.288 2003/03/21 14:36:16 mast Exp $ + || $Id: interpret.c,v 1.289 2003/03/23 12:35:08 jonasw Exp $   */      #include "global.h" - RCSID("$Id: interpret.c,v 1.288 2003/03/21 14:36:16 mast Exp $"); + RCSID("$Id: interpret.c,v 1.289 2003/03/23 12:35:08 jonasw Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"   #include "svalue.h"   #include "array.h"   #include "mapping.h"   #include "pike_error.h"   #include "language.h"   #include "stralloc.h"   #include "constants.h"
pike.git/src/interpret.c:103:      static void trace_return_value(void);   static void do_trace_call(INT32);      void gdb_stop_here(void)   {    ;   }       - /* mark stack, used to store markers into the normal stack */ - int mark_stack_malloced = 0; -  +    void push_sp_mark(void)   {    if(Pike_mark_sp == Pike_interpreter.mark_stack + Pike_stack_size)    Pike_error("No more mark stack!\n");    *Pike_mark_sp++=Pike_sp;   }   ptrdiff_t pop_sp_mark(void)   {   #ifdef PIKE_DEBUG    if(Pike_mark_sp < Pike_interpreter.mark_stack)
pike.git/src/interpret.c:194:    }    }    /* Don't keep this fd on exec() */    set_close_on_exec(fd, 1);    }   #endif      #define MMALLOC(X,Y) (Y *)mmap(0,X*sizeof(Y),PROT_READ|PROT_WRITE, MAP_NORESERVE | MAP_PRIVATE | MAP_ANONYMOUS, fd, 0)       Pike_interpreter.evaluator_stack_malloced=0; -  mark_stack_malloced=0; +  Pike_interpreter.mark_stack_malloced=0;    Pike_interpreter.evaluator_stack=MMALLOC(Pike_stack_size,struct svalue);    Pike_interpreter.mark_stack=MMALLOC(Pike_stack_size, struct svalue *);    if((char *)MAP_FAILED == (char *)Pike_interpreter.evaluator_stack) Pike_interpreter.evaluator_stack=0;    if((char *)MAP_FAILED == (char *)Pike_interpreter.mark_stack) Pike_interpreter.mark_stack=0;      use_malloc:      #else    Pike_interpreter.evaluator_stack=0;    Pike_interpreter.mark_stack=0;
pike.git/src/interpret.c:216:       if(!Pike_interpreter.evaluator_stack)    {    Pike_interpreter.evaluator_stack=(struct svalue *)xalloc(Pike_stack_size*sizeof(struct svalue));    Pike_interpreter.evaluator_stack_malloced=1;    }       if(!Pike_interpreter.mark_stack)    {    Pike_interpreter.mark_stack=(struct svalue **)xalloc(Pike_stack_size*sizeof(struct svalue *)); -  mark_stack_malloced=1; +  Pike_interpreter.mark_stack_malloced=1;    }       Pike_sp=Pike_interpreter.evaluator_stack;    Pike_mark_sp=Pike_interpreter.mark_stack;    Pike_fp=0;       Pike_interpreter.svalue_stack_margin = SVALUE_STACK_MARGIN;    Pike_interpreter.c_stack_margin = C_STACK_MARGIN;      #ifdef PIKE_DEBUG
pike.git/src/interpret.c:2381:    }   #endif    reset_evaluator();      #ifdef USE_MMAP_FOR_STACK    if(!Pike_interpreter.evaluator_stack_malloced)    {    munmap((char *)Pike_interpreter.evaluator_stack, Pike_stack_size*sizeof(struct svalue));    Pike_interpreter.evaluator_stack=0;    } -  if(!mark_stack_malloced) +  if(!Pike_interpreter.mark_stack_malloced)    {    munmap((char *)Pike_interpreter.mark_stack, Pike_stack_size*sizeof(struct svalue *));    Pike_interpreter.mark_stack=0;    }   #endif       if(Pike_interpreter.evaluator_stack) free((char *)Pike_interpreter.evaluator_stack);    if(Pike_interpreter.mark_stack) free((char *)Pike_interpreter.mark_stack);       Pike_interpreter.mark_stack=0;    Pike_interpreter.evaluator_stack=0; -  mark_stack_malloced=0; +  Pike_interpreter.mark_stack_malloced=0;    Pike_interpreter.evaluator_stack_malloced=0;   }      void really_clean_up_interpret(void)   {   #ifdef DO_PIKE_CLEANUP   #if 0    struct pike_frame_block *p;    int e;    for(p=pike_frame_blocks;p;p=p->next)    for(e=0;e<128;e++)    debug_malloc_dump_references( p->x + e);   #endif    free_all_pike_frame_blocks();   #endif   }