Don't manipulate GC flags directly
We need to disable the GC around compaction (for now) because object id book keeping can cause malloc to happen and that can trigger GC.
This commit is contained in:
parent
f91879a7b5
commit
12762b76cb
4
gc.c
4
gc.c
@ -8217,9 +8217,9 @@ gc_compact(rb_objspace_t *objspace, int use_toward_empty, int use_double_pages,
|
||||
/* pin objects referenced by maybe pointers */
|
||||
rb_gc();
|
||||
/* compact */
|
||||
during_gc = TRUE;
|
||||
rb_gc_disable();
|
||||
gc_compact_after_gc(objspace, use_toward_empty, use_double_pages, TRUE);
|
||||
during_gc = FALSE;
|
||||
rb_gc_enable();
|
||||
}
|
||||
objspace->flags.during_compacting = FALSE;
|
||||
return gc_compact_stats(objspace);
|
||||
|
Loading…
x
Reference in New Issue
Block a user