Set STR_SHARED_ROOT flag on root of string
This commit is contained in:
parent
2ad081f799
commit
9726736006
Notes:
git
2023-01-09 13:49:56 +00:00
1
string.c
1
string.c
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user