pike.git / src / interpret.h

version» Context lines:

pike.git/src/interpret.h: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.   \*/      /* -  * $Id: interpret.h,v 1.69 2000/12/01 08:09:48 hubbe Exp $ +  * $Id: interpret.h,v 1.70 2000/12/04 19:39:46 mast Exp $    */   #ifndef INTERPRET_H   #define INTERPRET_H      #include "global.h"   #include "program.h"   #include "pike_error.h"      struct Pike_interpreter {    /* Swapped variables */
pike.git/src/interpret.h:67:   };      struct external_variable_context   {    struct object *o;    struct inherit *inherit;    int parent_identifier;   };      #ifdef PIKE_DEBUG - #define debug_check_stack() do{if(Pike_sp<Pike_interpreter.evaluator_stack)fatal("Stack Pike_error.\n");}while(0) + #define debug_check_stack() do{if(Pike_sp<Pike_interpreter.evaluator_stack)fatal("Stack error.\n");}while(0)   #define check__positive(X,Y) if((X)<0) fatal Y   #include "pike_error.h"   #else   #define check__positive(X,Y)   #define debug_check_stack()   #endif    -  + #define low_stack_check(X) \ +  (Pike_sp - Pike_interpreter.evaluator_stack + \ +  Pike_interpreter.svalue_stack_margin + (X) >= Pike_stack_size) +  + PMOD_EXPORT const char *Pike_check_stack_errmsg; +    #define check_stack(X) do { \ -  if(Pike_sp - Pike_interpreter.evaluator_stack + \ -  Pike_interpreter.svalue_stack_margin + (X) >= Pike_stack_size) \ -  Pike_error("Svalue stack overflow. " \ -  "(%ld of %ld entries on stack, needed %ld more entries)\n", \ +  if(low_stack_check(X)) \ +  Pike_error(Pike_check_stack_errmsg, \    PTRDIFF_T_TO_LONG(Pike_sp - Pike_interpreter.evaluator_stack), \    PTRDIFF_T_TO_LONG(Pike_stack_size), \    PTRDIFF_T_TO_LONG(X)); \    }while(0)    -  + PMOD_EXPORT const char *Pike_check_mark_stack_errmsg; +    #define check_mark_stack(X) do { \    if(Pike_mark_sp - Pike_interpreter.mark_stack + (X) >= Pike_stack_size) \ -  Pike_error("Mark stack overflow.\n"); \ +  Pike_error(Pike_check_mark_stack_errmsg); \    }while(0)    -  + PMOD_EXPORT const char *Pike_check_c_stack_errmsg; +    #define check_c_stack(X) do { \    ptrdiff_t x_= ((char *)&x_) + \    STACK_DIRECTION * (Pike_interpreter.c_stack_margin + (X)) - \    Pike_interpreter.stack_top ; \    x_*=STACK_DIRECTION; \    if(x_>0) \ -  low_error("C stack overflow.\n"); \ +  low_error(Pike_check_c_stack_errmsg); \    }while(0)      #define fatal_check_c_stack(X) do { \    ptrdiff_t x_= \    ((char *)&x_) + STACK_DIRECTION * (X) - Pike_interpreter.stack_top ; \    x_*=STACK_DIRECTION; \    if(x_>0) { \ -  fatal("C stack overflow.\n"); \ +  fatal(Pike_check_c_stack_errmsg); \    } \    }while(0)         #define pop_stack() do{ free_svalue(--Pike_sp); debug_check_stack(); }while(0)      #ifdef __ECL   #define MAYBE_CAST_TO_LONG(X) (X)   #else /* !__ECL */   #define MAYBE_CAST_TO_LONG(X) ((long)(X))
pike.git/src/interpret.h:256:   PMOD_EXPORT int apply_low_safe_and_stupid(struct object *o, INT32 offset);   PMOD_EXPORT void safe_apply_low(struct object *o,int fun,int args);   PMOD_EXPORT void safe_apply(struct object *o, char *fun ,INT32 args);   PMOD_EXPORT void apply_lfun(struct object *o, int fun, int args);   PMOD_EXPORT void apply_shared(struct object *o,    struct pike_string *fun,    int args);   PMOD_EXPORT void apply(struct object *o, char *fun, int args);   PMOD_EXPORT void apply_svalue(struct svalue *s, INT32 args);   PMOD_EXPORT void slow_check_stack(void); + PMOD_EXPORT void custom_check_stack(size_t amount, const char *fmt, ...) +  ATTRIBUTE((format (printf, 2, 3)));   void cleanup_interpret(void);   void really_clean_up_interpret(void);   /* Prototypes end here */      /* These need to be after the prototypes,    * to avoid implicit declaration of mega_apply().    */   #ifdef __ECL   static inline void apply_low(struct object *o, ptrdiff_t fun, INT32 args)   {