fix -DMM=0

This commit is contained in:
dzaima 2022-11-15 18:25:51 +02:00
parent c508e2ccd9
commit a48f1f5eb0
3 changed files with 2 additions and 7 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);