fix logic flaw in GC

This commit is contained in:
Yuichi Nishiwaki
2013-12-03 11:45:38 +09:00
parent 704b2d148b
commit 7685afdb79
3 changed files with 177 additions and 38 deletions
+9 -3
View File
@@ -11,13 +11,19 @@ union header {
union header *ptr;
size_t size;
enum pic_gc_mark mark;
enum pic_tt tt;
} s;
long alignment; /* force alignment for headers to be allocated at the size of long */
long alignment[2];
};
struct heap_page {
union header *basep, *endp;
struct heap_page *next;
};
struct pic_heap {
union header base, *freep, *endp;
size_t heap_size;
union header base, *freep;
struct heap_page *pages;
};
void init_heap(struct pic_heap *);