diff --git a/src/h.h b/src/h.h index 210ed0ee..d61f518e 100644 --- a/src/h.h +++ b/src/h.h @@ -327,6 +327,7 @@ typedef void (*vfn)(void); void gc_add(B x); // add permanent root object void gc_addFn(vfn f); // add function that calls mm_visit/mm_visitP for dynamic roots +void gc_add_ref(B* x); // add x as a root reference void gc_maybeGC(void); // gc if that seems necessary void gc_forceGC(void); // force a gc; who knows what happens if gc is disabled (probably should error) void gc_visitRoots(void); diff --git a/src/opt/gc.h b/src/opt/gc.h index 535a49f0..8eaa38da 100644 --- a/src/opt/gc.h +++ b/src/opt/gc.h @@ -3,10 +3,6 @@ extern u64 gc_depth; static void gc_disable() { gc_depth++; } static void gc_enable() { gc_depth--; } -void gc_addFn(vfn f); -void gc_add(B x); -void gc_add_ref(B* x); - #ifdef LOG_GC extern u64 gc_visitBytes, gc_visitCount, gc_freedBytes, gc_freedCount; diff --git a/src/opt/mm_malloc.h b/src/opt/mm_malloc.h index 99840232..d8744633 100644 --- a/src/opt/mm_malloc.h +++ b/src/opt/mm_malloc.h @@ -4,7 +4,7 @@ extern u64 mm_heapAlloc; extern u64 mm_heapMax; static void mm_free(Value* x) { - preFree(x); + preFree(x, false); free(x); } @@ -23,8 +23,6 @@ static void gc_enable() { } static void mm_visit(B x) { } static void mm_visitP(void* x) { } -void gc_add(B x); -void gc_addFn(vfn f); void gc_maybeGC(void); void gc_forceGC(void); void gc_visitRoots(void);