diff options
author | Aaron Patterson <[email protected]> | 2023-10-25 16:52:37 -0700 |
---|---|---|
committer | Aaron Patterson <[email protected]> | 2023-11-20 16:09:48 -0800 |
commit | 6fce8c79807e69cfe475b5291e892567c869fbcc (patch) | |
tree | 42419f2e00fea8e2d05674873dcbfccb511b83f4 /gc.c | |
parent | 7164715666cfbffd5540ee374eee2a5568342d2d (diff) |
Don't try compacting ivars on Classes that are "too complex"
Too complex classes use a hash table to store ivs, and should always pin
their IVs. We shouldn't touch those classes in compaction.
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -10608,8 +10608,10 @@ gc_update_object_references(rb_objspace_t *objspace, VALUE obj) update_cvc_tbl(objspace, obj); update_superclasses(objspace, obj); - for (attr_index_t i = 0; i < RCLASS_IV_COUNT(obj); i++) { - UPDATE_IF_MOVED(objspace, RCLASS_IVPTR(obj)[i]); + if (!rb_shape_obj_too_complex(obj)) { + for (attr_index_t i = 0; i < RCLASS_IV_COUNT(obj); i++) { + UPDATE_IF_MOVED(objspace, RCLASS_IVPTR(obj)[i]); + } } update_class_ext(objspace, RCLASS_EXT(obj)); |