зеркало из https://github.com/github/ruby.git
* 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:
Родитель
38cd45a3cd
Коммит
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>
|
||||
|
||||
* 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_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));
|
||||
}
|
||||
}
|
||||
|
@ -1009,7 +1010,6 @@ str_replace(VALUE str, VALUE str2)
|
|||
STR_SET_NOEMBED(str);
|
||||
RSTRING(str)->as.heap.len = len;
|
||||
RSTRING(str)->as.heap.ptr = RSTRING_PTR(str2);
|
||||
FL_SET(str, STR_SHARED);
|
||||
STR_SET_SHARED(str, shared);
|
||||
}
|
||||
else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче