diff options
author | Aaron Patterson <[email protected]> | 2019-07-19 15:12:02 -0700 |
---|---|---|
committer | Aaron Patterson <[email protected]> | 2019-07-19 15:12:50 -0700 |
commit | d304f77c585c42a2e8b008d170ac153b7d8e5243 (patch) | |
tree | c31dc75d2697e4ffe4813608a8ff39679326f906 /gc.c | |
parent | c945d115a55710089ac23027c74ed32a40cd9e50 (diff) |
Only disable GC around reference updating
This is the only place that can change the size of the object id tables
and cause a GC.
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -8215,9 +8215,7 @@ gc_compact(rb_objspace_t *objspace, int use_toward_empty, int use_double_pages, /* pin objects referenced by maybe pointers */ rb_gc(); /* compact */ - rb_gc_disable(); gc_compact_after_gc(objspace, use_toward_empty, use_double_pages, TRUE); - rb_gc_enable(); } objspace->flags.during_compacting = FALSE; return gc_compact_stats(objspace); @@ -8312,7 +8310,10 @@ gc_compact_after_gc(rb_objspace_t *objspace, int use_toward_empty, int use_doubl moved_list = gc_compact_heap(objspace, compare_pinned); } heap_eden->freelist = NULL; + + VALUE disabled = rb_gc_disable(); gc_update_references(objspace); + if (!RTEST(disabled)) rb_gc_enable(); if (use_verifier) { gc_check_references_for_moved(Qnil); |