ruby-changes:63142
From: Aaron <ko1@a...>
Date: Sat, 26 Sep 2020 07:52:23 +0900 (JST)
Subject: [ruby-changes:63142] 137fa5b27e (master): Fibers should update themselves on compaction
https://git.ruby-lang.org/ruby.git/commit/?id=137fa5b27e From 137fa5b27e6db535fcf42e4390b42ca8adc9dacd Mon Sep 17 00:00:00 2001 From: Aaron Patterson <tenderlove@r...> Date: Fri, 25 Sep 2020 09:18:12 -0700 Subject: Fibers should update themselves on compaction We should let fibers update their own references on compaction. I don't think we need the thread to update the associated fiber because there will be a fiber object on the heap that knows how to update itself. diff --git a/vm.c b/vm.c index 15b305e..076bbbe 100644 --- a/vm.c +++ b/vm.c @@ -2658,11 +2658,10 @@ static void https://github.com/ruby/ruby/blob/trunk/vm.c#L2658 thread_compact(void *ptr) { rb_thread_t *th = ptr; - rb_fiber_update_self(th->ec->fiber_ptr); - if (th->root_fiber) rb_fiber_update_self(th->root_fiber); - - rb_execution_context_update(th->ec); + if (!th->root_fiber) { + rb_execution_context_update(th->ec); + } } static void -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/