ruby-changes:56602
From: Aaron <ko1@a...>
Date: Sat, 20 Jul 2019 07:13:16 +0900 (JST)
Subject: [ruby-changes:56602] Aaron Patterson: d304f77c58 (master): Only disable GC around reference updating
https://git.ruby-lang.org/ruby.git/commit/?id=d304f77c58 From d304f77c585c42a2e8b008d170ac153b7d8e5243 Mon Sep 17 00:00:00 2001 From: Aaron Patterson <tenderlove@r...> Date: Fri, 19 Jul 2019 15:12:02 -0700 Subject: 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. diff --git a/gc.c b/gc.c index df48bc1..1c2959c 100644 --- a/gc.c +++ b/gc.c @@ -8215,9 +8215,7 @@ gc_compact(rb_objspace_t *objspace, int use_toward_empty, int use_double_pages, https://github.com/ruby/ruby/blob/trunk/gc.c#L8215 /* 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 https://github.com/ruby/ruby/blob/trunk/gc.c#L8310 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); -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/