summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2020-09-25 09:18:12 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2020-09-25 15:52:04 -0700
commit137fa5b27e6db535fcf42e4390b42ca8adc9dacd (patch)
treede29f256ea35f7a57887045a34b69e09e432f10c /vm.c
parent8b42474a2604f35f6d2a635562ef16efc1af456c (diff)
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.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3588
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/vm.c b/vm.c
index 15b305e..076bbbe 100644
--- a/vm.c
+++ b/vm.c
@@ -2658,11 +2658,10 @@ static void
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