diff options
author | Peter Zhu <[email protected]> | 2023-01-06 16:18:29 -0500 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2023-01-09 08:49:29 -0500 |
commit | 9726736006b3f74635fd8af05814fe0908e2cf84 (patch) | |
tree | 091cadd2d52b0fe82d690331446b82aac0ccf176 /string.c | |
parent | 2ad081f79964b2312b6e45c8c98196f300f61937 (diff) |
Set STR_SHARED_ROOT flag on root of string
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7071
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -1787,6 +1787,7 @@ str_duplicate_setup(VALUE klass, VALUE str, VALUE dup) else { RSTRING(dup)->as.heap.len = RSTRING_LEN(str); RSTRING(dup)->as.heap.ptr = RSTRING_PTR(str); + FL_SET(root, STR_SHARED_ROOT); RB_OBJ_WRITE(dup, &RSTRING(dup)->as.heap.aux.shared, root); flags |= RSTRING_NOEMBED | STR_SHARED; } |