replace mock allocator with simple k&r malloc
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user