diff --git a/src/gc-debug.c b/src/gc-debug.c index ba6a83a9085b4..a0149cb46f9ea 100644 --- a/src/gc-debug.c +++ b/src/gc-debug.c @@ -338,6 +338,8 @@ static void gc_scrub_range(char *stack_lo, char *stack_hi) jl_taggedvalue_t *tag = jl_gc_find_taggedvalue_pool(p, &osize); if (!tag || gc_marked(tag) || osize <= sizeof_jl_taggedvalue_t) continue; + // Make sure the sweep rebuild the freelist + page_metadata(tag)->allocd = 1; memset(tag, 0xff, osize); } } diff --git a/src/gc.c b/src/gc.c index ad469815c458d..f47241466f099 100644 --- a/src/gc.c +++ b/src/gc.c @@ -2086,8 +2086,8 @@ void jl_gc_collect(int full) #endif estimate_freed = live_bytes - scanned_bytes - perm_scanned_bytes + actual_allocd; - gc_scrub(stack_hi); gc_verify(); + gc_scrub(stack_hi); #if defined(MEMPROFILE) all_pool_stats();