pike.git/
src/
interpret.c
Branch:
Tag:
Non-build tags
All tags
No tags
2013-08-01
2013-08-01 17:02:42 by Arne Goedeke <el@laramies.com>
6af003122d27ff68bd688919a337d6bf2560c309 (
20
lines) (+
16
/-
4
)
[
Show
|
Annotate
]
Branch:
7.9
interpreter: use valgrind mempool macros for pike frame allocator
298:
return 0; /* OK. */ }
+
static struct pike_frame *free_pike_frame = NULL;
+
PMOD_EXPORT void init_interpreter(void) {
-
+
#ifdef HAVE_VALGRIND_MACROS
+
VALGRIND_CREATE_MEMPOOL(&free_pike_frame, 0, 0);
+
#endif
if (low_init_interpreter(Pike_interpreter_pointer)) { Pike_fatal("Out of memory initializing the interpreter stack.\n"); }
1936:
free(s); }
-
static struct pike_frame *free_pike_frame;
+
static struct pike_frame_chunk { struct pike_frame_chunk *next; } *pike_frame_chunks;
1965:
DO_IF_SECURITY( X->current_creds=0; ) ); X->next = free_pike_frame;
-
PIKE
_
MEM
_
NA
(
*
X);
+
#ifdef
HAVE_VALGRIND_MACROS
+
VALGRIND
_
MEMPOOL
_
FREE
(
&free_pike_frame,
X);
+
#endif
free_pike_frame = X; }
1975:
if( free_pike_frame ) { res = free_pike_frame;
-
PIKE
_MEM_
RW
(res->next);
+
#ifdef
HAVE_VALGRIND_MACROS
+
VALGRIND
_
MEMPOOL_ALLOC(&free_pike_frame, res, sizeof(struct pike_frame));
+
VALGRIND_MAKE_
MEM_
DEFINED
(
&
res->next
, sizeof(void*
)
)
;
+
#endif
free_pike_frame = res->next;
-
PIKE
_MEM_
WO
(
*
res);
+
#ifdef
HAVE_VALGRIND_MACROS
+
VALGRIND
_
MAKE_
MEM_
UNDEFINED
(
&res->next, sizeof(void
*)
)
;
+
#endif
res->refs=0; add_ref(res); /* For DMALLOC... */ res->flags=0;