ruby-changes:65281
From: Koichi <ko1@a...>
Date: Thu, 18 Feb 2021 16:41:20 +0900 (JST)
Subject: [ruby-changes:65281] 969b824a0c (master): sync GC rest if needed
https://git.ruby-lang.org/ruby.git/commit/?id=969b824a0c From 969b824a0c7605e0e570631d967ad0de0c37d0bf Mon Sep 17 00:00:00 2001 From: Koichi Sasada <ko1@a...> Date: Thu, 18 Feb 2021 15:47:32 +0900 Subject: sync GC rest if needed marking requires a barrier (stop all Ractors) and gc_enter() does it. However, it doesn't check rest event which can start marking. [Bug #17599] --- gc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gc.c b/gc.c index 63a2268..33d4632 100644 --- a/gc.c +++ b/gc.c @@ -8477,6 +8477,9 @@ gc_enter(rb_objspace_t *objspace, enum gc_enter_event event, unsigned int *lock_ https://github.com/ruby/ruby/blob/trunk/gc.c#L8477 RB_VM_LOCK_ENTER_LEV(lock_lev); switch (event) { + case gc_enter_event_rest: + if (!is_marking(objspace)) break; + // fall through case gc_enter_event_start: case gc_enter_event_mark_continue: // stop other ractors -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/