replace mock allocator with simple k&r malloc

This commit is contained in:
Yuichi Nishiwaki
2013-10-13 15:14:15 +09:00
parent 38858e7a11
commit e3600a65c9
4 changed files with 95 additions and 7 deletions
+4
View File
@@ -17,11 +17,15 @@ struct pic_proc {
} u;
};
#define PIC_HEAP_SIZE 1024
typedef struct {
pic_value *sp;
pic_value *stbase, *stend;
struct pic_env *global_env;
struct heap_page *heap;
} pic_state;
void *pic_alloc(pic_state *, size_t);
+16
View File
@@ -0,0 +1,16 @@
#ifndef GC_H__
#define GC_H__
struct header {
struct header *ptr;
size_t size;
};
struct heap_page {
struct header *base, *freep;
size_t heap_size;
};
void init_heap_page(struct heap_page *);
#endif