* string.c (rb_str_free): use FL_TEST(str, STR_SHARED) directly
because str is not embed. * string.c (str_replace): remove `FL_SET(str, STR_SHARED)' line because STR_SET_SHARED() set STR_SHARED. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
38cd45a3cd
commit
3889ce2d15
@ -1,3 +1,11 @@
|
|||||||
|
Wed Feb 5 13:29:01 2014 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* string.c (rb_str_free): use FL_TEST(str, STR_SHARED) directly
|
||||||
|
because str is not embed.
|
||||||
|
|
||||||
|
* string.c (str_replace): remove `FL_SET(str, STR_SHARED)' line
|
||||||
|
because STR_SET_SHARED() set STR_SHARED.
|
||||||
|
|
||||||
Wed Feb 5 13:18:08 2014 Koichi Sasada <ko1@atdot.net>
|
Wed Feb 5 13:18:08 2014 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* internal.h: remove macros STR_NOCAPA and STR_NOCAPA_P().
|
* internal.h: remove macros STR_NOCAPA and STR_NOCAPA_P().
|
||||||
|
4
string.c
4
string.c
@ -915,7 +915,8 @@ rb_str_free(VALUE str)
|
|||||||
st_data_t fstr = (st_data_t)str;
|
st_data_t fstr = (st_data_t)str;
|
||||||
st_delete(frozen_strings, &fstr, NULL);
|
st_delete(frozen_strings, &fstr, NULL);
|
||||||
}
|
}
|
||||||
if (!STR_EMBED_P(str) && !STR_SHARED_P(str)) {
|
|
||||||
|
if (!STR_EMBED_P(str) && !FL_TEST(str, STR_SHARED)) {
|
||||||
ruby_sized_xfree(STR_HEAP_PTR(str), STR_HEAP_SIZE(str));
|
ruby_sized_xfree(STR_HEAP_PTR(str), STR_HEAP_SIZE(str));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1009,7 +1010,6 @@ str_replace(VALUE str, VALUE str2)
|
|||||||
STR_SET_NOEMBED(str);
|
STR_SET_NOEMBED(str);
|
||||||
RSTRING(str)->as.heap.len = len;
|
RSTRING(str)->as.heap.len = len;
|
||||||
RSTRING(str)->as.heap.ptr = RSTRING_PTR(str2);
|
RSTRING(str)->as.heap.ptr = RSTRING_PTR(str2);
|
||||||
FL_SET(str, STR_SHARED);
|
|
||||||
STR_SET_SHARED(str, shared);
|
STR_SET_SHARED(str, shared);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user