Skip to content

Commit b47c8b7

Browse files
committed
gc.c (clear_all_old): fix a generational GC bug
This issue was caused by 375d22b that introduced a serious mark leakage in the generational GC mode.
1 parent 0bb0871 commit b47c8b7

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/gc.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,14 +1240,12 @@ clear_all_old(mrb_state *mrb, mrb_gc *gc)
12401240
/* finish the half baked GC */
12411241
incremental_gc_finish(mrb, gc);
12421242
}
1243-
else {
1244-
/* Sweep the dead objects, then reset all the live objects
1245-
* (including all the old objects, of course) to white. */
1246-
gc->generational = FALSE;
1247-
prepare_incremental_sweep(mrb, gc);
1248-
incremental_gc_finish(mrb, gc);
1249-
gc->generational = TRUE;
1250-
}
1243+
/* Sweep the dead objects, then reset all the live objects
1244+
* (including all the old objects, of course) to white. */
1245+
gc->generational = FALSE;
1246+
prepare_incremental_sweep(mrb, gc);
1247+
incremental_gc_finish(mrb, gc);
1248+
gc->generational = TRUE;
12511249
/* The gray objects have already been painted as white */
12521250
gc->atomic_gray_list = gc->gray_list = NULL;
12531251
}

0 commit comments

Comments
 (0)