summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gc.c b/gc.c
index 9866ed579d..b30c022356 100644
--- a/gc.c
+++ b/gc.c
@@ -10611,16 +10611,18 @@ gc_update_object_references(rb_objspace_t *objspace, VALUE obj)
#if USE_RVARGC
VALUE new_root = any->as.string.as.heap.aux.shared;
rb_str_update_shared_ary(obj, old_root, new_root);
+#endif
+ }
- // if, after move the string is not embedded, and can fit in the
- // slot it's been placed in, then re-embed it
- if (rb_gc_obj_slot_size(obj) >= rb_str_size_as_embedded(obj)) {
- if (!STR_EMBED_P(obj) && rb_str_reembeddable_p(obj)) {
- rb_str_make_embedded(obj);
- }
+#if USE_RVARGC
+ /* If, after move the string is not embedded, and can fit in the
+ * slot it's been placed in, then re-embed it. */
+ if (rb_gc_obj_slot_size(obj) >= rb_str_size_as_embedded(obj)) {
+ if (!STR_EMBED_P(obj) && rb_str_reembeddable_p(obj)) {
+ rb_str_make_embedded(obj);
}
-#endif
}
+#endif
break;
}