diff options
author | Peter Zhu <peter@peterzhu.ca> | 2023-11-24 10:25:06 -0500 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2023-11-24 13:29:04 -0500 |
commit | 269c705f93c4db631f4cad89991bc5d69a7dcd03 (patch) | |
tree | ab71fb98e0a7465aae04ff3a2338222c58a51104 /gc.c | |
parent | e201b81f79828c30500947fe8c8ea3c515e3d112 (diff) | |
download | ruby-269c705f93c4db631f4cad89991bc5d69a7dcd03.tar.gz |
Fix compaction for generic ivars
When generic instance variable has a shape, it is marked movable. If it
it transitions to too complex, it needs to update references otherwise
it may have incorrect references.
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -7255,7 +7255,7 @@ gc_mark_children(rb_objspace_t *objspace, VALUE obj) gc_mark_set_parent(objspace, obj); if (FL_TEST(obj, FL_EXIVAR)) { - rb_mark_and_update_generic_ivar(obj); + rb_mark_generic_ivar(obj); } switch (BUILTIN_TYPE(obj)) { @@ -10249,6 +10249,12 @@ gc_ref_update_table_values_only(rb_objspace_t *objspace, st_table *tbl) } } +void +rb_gc_ref_update_table_values_only(st_table *tbl) +{ + gc_ref_update_table_values_only(&rb_objspace, tbl); +} + static void gc_update_table_refs(rb_objspace_t * objspace, st_table *tbl) { @@ -10623,7 +10629,7 @@ gc_update_object_references(rb_objspace_t *objspace, VALUE obj) gc_report(4, objspace, "update-refs: %p ->\n", (void *)obj); if (FL_TEST(obj, FL_EXIVAR)) { - rb_mark_and_update_generic_ivar(obj); + rb_ref_update_generic_ivar(obj); } switch (BUILTIN_TYPE(obj)) { |