pike.git
/
src
/
constants.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/constants.c:7:
#include "global.h" #include "constants.h" #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 "pike_error.h"
-
#include "pike_security.h"
+
#include "gc.h" #include "block_allocator.h" struct mapping *builtin_constants = 0; #ifdef PIKE_DEBUG struct callable *first_callable = NULL; #endif /* This is the mapping returned by all_constants(). */
pike.git/src/constants.c:71:
static struct block_allocator callable_allocator = BA_INIT_PAGES(sizeof(struct callable), 2); void really_free_callable(struct callable * c) { #ifdef PIKE_DEBUG DOUBLEUNLINK (first_callable, c); #endif free_type(c->type); free_string(c->name); c->name=0;
-
EXIT_PIKE_MEMOBJ(c);
+
ba_free(&callable_allocator, c); } void count_memory_in_callables(size_t * num, size_t * size) { ba_count_all(&callable_allocator, num, size); } void free_all_callable_blocks(void) { ba_destroy(&callable_allocator); }
pike.git/src/constants.c:96:
struct pike_string *name, struct pike_type *type, int flags, optimize_fun optimize, docode_fun docode) { struct callable *f=ba_alloc(&callable_allocator); #ifdef PIKE_DEBUG DOUBLELINK(first_callable, f); #endif
-
INIT_PIKE_MEMOBJ(
f
, T_STRUCT_CALLABLE)
;
+
f
->refs=1
;
f->function=fun; f->name=name; f->type=type; f->prog=Pike_compiler->new_program; f->flags=flags; f->docode=docode; f->optimize=optimize; f->internal_flags = global_callable_flags; #ifdef PIKE_DEBUG {