diff options
author | Aaron Patterson <tenderlove@ruby-lang.org> | 2020-09-22 08:57:48 -0700 |
---|---|---|
committer | Aaron Patterson <tenderlove@ruby-lang.org> | 2020-09-22 08:57:48 -0700 |
commit | 8b41e9b6e77b74ba7b90774dc1ff1959b95ca61a (patch) | |
tree | fbb8a9c03c94ee22e4116e35a57c428a4ec2bba7 /gc.c | |
parent | df14c758fc705c49c2aaf4c9276a8f7229438fbf (diff) | |
download | ruby-8b41e9b6e77b74ba7b90774dc1ff1959b95ca61a.tar.gz |
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.
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -7860,6 +7860,11 @@ gc_is_moveable_obj(rb_objspace_t *objspace, VALUE obj) 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) 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); |