mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
gc.c (clear_all_old): simplify the code
The function is called only with generational mode.
This commit is contained in:
@@ -1233,10 +1233,8 @@ incremental_gc_step(mrb_state *mrb, mrb_gc *gc)
|
||||
static void
|
||||
clear_all_old(mrb_state *mrb, mrb_gc *gc)
|
||||
{
|
||||
mrb_bool origin_mode = gc->generational;
|
||||
|
||||
mrb_assert(is_generational(gc));
|
||||
if (is_major_gc(gc)) {
|
||||
if (gc->full) {
|
||||
/* finish the half baked GC */
|
||||
incremental_gc_finish(mrb, gc);
|
||||
}
|
||||
@@ -1246,9 +1244,8 @@ clear_all_old(mrb_state *mrb, mrb_gc *gc)
|
||||
gc->generational = FALSE;
|
||||
prepare_incremental_sweep(mrb, gc);
|
||||
incremental_gc_finish(mrb, gc);
|
||||
gc->generational = TRUE;
|
||||
}
|
||||
gc->generational = origin_mode;
|
||||
|
||||
/* The gray objects have already been painted as white */
|
||||
gc->atomic_gray_list = gc->gray_list = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user