1
0
Fork 0
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:
Koichi Sasada 2020-09-16 09:04:13 +09:00
parent 609e6ac0ca
commit dd5db6f5fe
Notes: git 2020-09-18 14:18:21 +09:00

View file

@ -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)) {