ruby-changes:63040
From: Aaron <ko1@a...>
Date: Wed, 23 Sep 2020 01:01:21 +0900 (JST)
Subject: [ruby-changes:63040] 8b41e9b6e7 (master): Revert "Pin values in the finalizer table"
https://git.ruby-lang.org/ruby.git/commit/?id=8b41e9b6e7 From 8b41e9b6e77b74ba7b90774dc1ff1959b95ca61a Mon Sep 17 00:00:00 2001 From: Aaron Patterson <tenderlove@r...> Date: Tue, 22 Sep 2020 08:57:48 -0700 Subject: Revert "Pin values in the finalizer table" If an object has a finalizer flag set on it, prevent it from moving. This partially reverts commit 1a9dd31910699c7cd69f2a84c94af20eacd5875c. diff --git a/gc.c b/gc.c index aa63cdb..5e84f51 100644 --- a/gc.c +++ b/gc.c @@ -7860,6 +7860,11 @@ gc_is_moveable_obj(rb_objspace_t *objspace, VALUE obj) https://github.com/ruby/ruby/blob/trunk/gc.c#L7860 case T_RATIONAL: case T_NODE: case T_CLASS: + if (FL_TEST(obj, FL_FINALIZE)) { + if (st_is_member(finalizer_table, obj)) { + return FALSE; + } + } return RVALUE_MARKED(obj) && !RVALUE_PINNED(obj); default: @@ -8757,6 +8762,7 @@ gc_update_references(rb_objspace_t * objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L8762 gc_update_tbl_refs(objspace, objspace->obj_to_id_tbl); gc_update_table_refs(objspace, objspace->id_to_obj_tbl); gc_update_table_refs(objspace, global_symbols.str_sym); + gc_update_table_refs(objspace, finalizer_table); } static VALUE type_sym(size_t type); -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/