Permalink
Browse files

Avoid invoking GC when disabled or iterating; fix #3681

  • Loading branch information...
matz committed Jun 1, 2017
1 parent 87cc034 commit 51e0e690c27023e1f12603dc747aed3510638aaa
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/gc.c
View
@@ -1436,6 +1436,10 @@ gc_step_ratio_set(mrb_state *mrb, mrb_value obj)
static void
change_gen_gc_mode(mrb_state *mrb, mrb_gc *gc, mrb_bool enable)
{
if (gc->disabled || gc->iterating) {
gc->generational = enable;
return;
}
if (is_generational(gc) && !enable) {
clear_all_old(mrb, gc);
mrb_assert(gc->state == MRB_GC_STATE_ROOT);

0 comments on commit 51e0e69

Please sign in to comment.