Skip to content

Commit

Permalink
Disable GC during gc_each_objects(); fix #3616
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Apr 20, 2017
1 parent 62dae09 commit d2cad9a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,9 @@ static void
gc_each_objects(mrb_state *mrb, mrb_gc *gc, mrb_each_object_callback *callback, void *data)
{
mrb_heap_page* page = gc->heaps;
mrb_bool old_disable = gc->disabled;

gc->disabled = TRUE;
while (page != NULL) {
RVALUE *p, *pend;

Expand All @@ -1504,6 +1506,7 @@ gc_each_objects(mrb_state *mrb, mrb_gc *gc, mrb_each_object_callback *callback,

page = page->next;
}
gc->disabled = old_disable;
}

void
Expand Down

0 comments on commit d2cad9a

Please sign in to comment.