Finish compiler series

This commit is contained in:
2020-02-10 19:18:55 -08:00
parent e5d01a4e19
commit e7f0ccfa16
5 changed files with 573 additions and 15 deletions

View File

@@ -170,14 +170,16 @@ void gmachine_split(struct gmachine* g, size_t n) {
struct node_base* gmachine_track(struct gmachine* g, struct node_base* b) {
g->gc_node_count++;
if(g->gc_node_count >= g->gc_node_threshold) {
gc_visit_node(b);
gmachine_gc(g);
g->gc_node_threshold *= 2;
}
b->gc_next = g->gc_nodes;
g->gc_nodes = b;
if(g->gc_node_count >= g->gc_node_threshold) {
uint64_t nodes_before = g->gc_node_count;
gc_visit_node(b);
gmachine_gc(g);
g->gc_node_threshold = g->gc_node_count * 2;
}
return b;
}