pike.git/
src/
interpret.c
Branch:
Tag:
Non-build tags
All tags
No tags
2012-07-02
2012-07-02 13:16:37 by Arne Goedeke <el@laramies.com>
8e7a764ab13b5d1c30c318654c7654f1bc0495cf (
21
lines) (+
21
/-
0
)
[
Show
|
Annotate
]
Branch:
arne/block_alloc
gjalloc for pike frame structs
1925:
) \ }while(0)
+
#ifndef PIKE_NEW_BLOCK_ALLOC
BLOCK_ALLOC_FILL_PAGES(pike_frame, 4)
-
+
#else
+
#include "gjalloc.h"
+
struct block_allocator pike_frame_allocator = BA_INIT(sizeof(struct pike_frame),
+
4*4096/sizeof(struct pike_frame));
+
INLINE struct pike_frame * alloc_pike_frame() {
+
struct pike_frame * f = (struct pike_frame *)ba_alloc(&pike_frame_allocator);
+
INIT_BLOCK(f);
+
return f;
+
}
-
+
INLINE void really_free_pike_frame(struct pike_frame * f) {
+
EXIT_BLOCK(f);
+
ba_free(&pike_frame_allocator, f);
+
}
-
+
void count_memory_in_pike_frames(size_t * num, size_t * size) {
+
ba_count_all(&pike_frame_allocator, num, size);
+
}
+
#endif
+
+
void really_free_pike_scope(struct pike_frame *scope) { if(scope->flags & PIKE_FRAME_MALLOCED_LOCALS)