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.
This commit is contained in:
parent
c945d115a5
commit
d304f77c58
5
gc.c
5
gc.c
@ -8215,9 +8215,7 @@ gc_compact(rb_objspace_t *objspace, int use_toward_empty, int use_double_pages,
|
|||||||
/* pin objects referenced by maybe pointers */
|
/* pin objects referenced by maybe pointers */
|
||||||
rb_gc();
|
rb_gc();
|
||||||
/* compact */
|
/* compact */
|
||||||
rb_gc_disable();
|
|
||||||
gc_compact_after_gc(objspace, use_toward_empty, use_double_pages, TRUE);
|
gc_compact_after_gc(objspace, use_toward_empty, use_double_pages, TRUE);
|
||||||
rb_gc_enable();
|
|
||||||
}
|
}
|
||||||
objspace->flags.during_compacting = FALSE;
|
objspace->flags.during_compacting = FALSE;
|
||||||
return gc_compact_stats(objspace);
|
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);
|
moved_list = gc_compact_heap(objspace, compare_pinned);
|
||||||
}
|
}
|
||||||
heap_eden->freelist = NULL;
|
heap_eden->freelist = NULL;
|
||||||
|
|
||||||
|
VALUE disabled = rb_gc_disable();
|
||||||
gc_update_references(objspace);
|
gc_update_references(objspace);
|
||||||
|
if (!RTEST(disabled)) rb_gc_enable();
|
||||||
|
|
||||||
if (use_verifier) {
|
if (use_verifier) {
|
||||||
gc_check_references_for_moved(Qnil);
|
gc_check_references_for_moved(Qnil);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user