mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
sync fstring_table for deletion
Ractors can access this table simultaneously so we need to sync accesses.
This commit is contained in:
parent
609e6ac0ca
commit
dd5db6f5fe
Notes:
git
2020-09-18 14:18:21 +09:00
1 changed files with 7 additions and 2 deletions
9
string.c
9
string.c
|
@ -1378,8 +1378,13 @@ rb_str_free(VALUE str)
|
|||
{
|
||||
if (FL_TEST(str, RSTRING_FSTR)) {
|
||||
st_data_t fstr = (st_data_t)str;
|
||||
st_delete(rb_vm_fstring_table(), &fstr, NULL);
|
||||
RB_DEBUG_COUNTER_INC(obj_str_fstr);
|
||||
|
||||
RB_VM_LOCK_ENTER();
|
||||
{
|
||||
st_delete(rb_vm_fstring_table(), &fstr, NULL);
|
||||
RB_DEBUG_COUNTER_INC(obj_str_fstr);
|
||||
}
|
||||
RB_VM_LOCK_LEAVE();
|
||||
}
|
||||
|
||||
if (STR_EMBED_P(str)) {
|
||||
|
|
Loading…
Reference in a new issue