pike.git / src / constants.c

version» Context lines:

pike.git/src/constants.c:8:   #include "pike_macros.h"   #include "program.h"   #include "pike_types.h"   #include "stralloc.h"   #include "pike_memory.h"   #include "interpret.h"   #include "mapping.h"   #include "error.h"   #include "block_alloc.h"    - RCSID("$Id: constants.c,v 1.17 1999/04/15 04:08:09 hubbe Exp $"); + RCSID("$Id: constants.c,v 1.18 1999/05/02 08:11:37 hubbe Exp $");    - static INT32 num_callable=0; +    static struct mapping *builtin_constants = 0;      struct mapping *get_builtin_constants(void)   {    if(!builtin_constants)    builtin_constants=allocate_mapping(20);       return builtin_constants;   }   
pike.git/src/constants.c:57:      void add_global_program(char *name, struct program *p)   {    struct svalue s;    s.type=T_PROGRAM;    s.subtype=0;    s.u.program=p;    low_add_constant(name, &s);   }    - #undef INIT_BLOCK - #define INIT_BLOCK(X) num_callable++ +    #undef EXIT_BLOCK   #define EXIT_BLOCK(X) do { \    free_string(X->type); \    free_string(X->name); \ -  num_callable--; \ +    }while(0)   BLOCK_ALLOC(callable,128)      /* Eats one ref to 'type' and 'name' */   struct callable *low_make_callable(c_fun fun,    struct pike_string *name,    struct pike_string *type,    INT16 flags,    optimize_fun optimize,    docode_fun docode)
pike.git/src/constants.c:162:   void cleanup_added_efuns(void)   {   #ifdef DO_PIKE_CLEANUP    if(builtin_constants)    {    free_mapping(builtin_constants);    builtin_constants=0;    }   #endif   } - void count_memory_in_callables(INT32 *num_, INT32 *size_) - { -  *num_=num_callable; -  *size_=num_callable*sizeof(struct callable); - } +