diff --git a/src/core/gc.c b/src/core/gc.c index f9de7d42..6a1af02b 100644 --- a/src/core/gc.c +++ b/src/core/gc.c @@ -549,7 +549,6 @@ void janet_clear_memory(void) { #endif JanetGCObject *current = janet_vm.blocks; while (NULL != current) { - current->flags |= JANET_MEM_USEAFTERFREE; janet_deinit_block(current); JanetGCObject *next = current->data.next; gc_free_gcobj(current); diff --git a/src/core/gc.h b/src/core/gc.h index 151a2cc0..175caeba 100644 --- a/src/core/gc.h +++ b/src/core/gc.h @@ -38,7 +38,7 @@ #define janet_gc_settype(m, t) ((janet_gc_header(m)->flags |= (0xFF & (t)))) #define janet_gc_type(m) (janet_gc_header(m)->flags & 0xFF) -#define janet_gc_mark(m) do (janet_gc_header(m)->flags |= JANET_MEM_REACHABLE) +#define janet_gc_mark(m) (janet_gc_header(m)->flags |= JANET_MEM_REACHABLE) #define janet_gc_reachable(m) (janet_gc_header(m)->flags & JANET_MEM_REACHABLE) /* Memory types for the GC. Different from JanetType to include funcenv and funcdef. */