fix -DMM=0
This commit is contained in:
parent
c508e2ccd9
commit
a48f1f5eb0
1
src/h.h
1
src/h.h
@ -327,6 +327,7 @@ typedef void (*vfn)(void);
|
|||||||
|
|
||||||
void gc_add(B x); // add permanent root object
|
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_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_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_forceGC(void); // force a gc; who knows what happens if gc is disabled (probably should error)
|
||||||
void gc_visitRoots(void);
|
void gc_visitRoots(void);
|
||||||
|
|||||||
@ -3,10 +3,6 @@
|
|||||||
extern u64 gc_depth;
|
extern u64 gc_depth;
|
||||||
static void gc_disable() { gc_depth++; }
|
static void gc_disable() { gc_depth++; }
|
||||||
static void gc_enable() { 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
|
#ifdef LOG_GC
|
||||||
extern u64 gc_visitBytes, gc_visitCount, gc_freedBytes, gc_freedCount;
|
extern u64 gc_visitBytes, gc_visitCount, gc_freedBytes, gc_freedCount;
|
||||||
|
|||||||
@ -4,7 +4,7 @@ extern u64 mm_heapAlloc;
|
|||||||
extern u64 mm_heapMax;
|
extern u64 mm_heapMax;
|
||||||
|
|
||||||
static void mm_free(Value* x) {
|
static void mm_free(Value* x) {
|
||||||
preFree(x);
|
preFree(x, false);
|
||||||
free(x);
|
free(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,8 +23,6 @@ static void gc_enable() { }
|
|||||||
static void mm_visit(B x) { }
|
static void mm_visit(B x) { }
|
||||||
static void mm_visitP(void* x) { }
|
static void mm_visitP(void* x) { }
|
||||||
|
|
||||||
void gc_add(B x);
|
|
||||||
void gc_addFn(vfn f);
|
|
||||||
void gc_maybeGC(void);
|
void gc_maybeGC(void);
|
||||||
void gc_forceGC(void);
|
void gc_forceGC(void);
|
||||||
void gc_visitRoots(void);
|
void gc_visitRoots(void);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user