gc.c (clear_all_old): avoid calling GC twice in the function

This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-12-06 15:26:24 +09:00
parent b3c95f3851
commit 375d22b412
+7 -6
View File
@@ -1287,12 +1287,13 @@ clear_all_old(mrb_state *mrb, mrb_gc *gc)
/* finish the half baked GC */
incremental_gc_finish(mrb, gc);
}
/* Sweep the dead objects, then reset all the live objects
* (including all the old objects, of course) to white. */
gc->generational = FALSE;
prepare_incremental_sweep(mrb, gc);
incremental_gc_finish(mrb, gc);
else {
/* Sweep the dead objects, then reset all the live objects
* (including all the old objects, of course) to white. */
gc->generational = FALSE;
prepare_incremental_sweep(mrb, gc);
incremental_gc_finish(mrb, gc);
}
gc->generational = origin_mode;
/* The gray objects have already been painted as white */