ruby-changes:63000
From: Koichi <ko1@a...>
Date: Fri, 18 Sep 2020 14:18:11 +0900 (JST)
Subject: [ruby-changes:63000] dd5db6f5fe (master): sync fstring_table for deletion
https://git.ruby-lang.org/ruby.git/commit/?id=dd5db6f5fe From dd5db6f5fed359efc85cff25d326b5fc3de66614 Mon Sep 17 00:00:00 2001 From: Koichi Sasada <ko1@a...> Date: Wed, 16 Sep 2020 09:04:13 +0900 Subject: sync fstring_table for deletion Ractors can access this table simultaneously so we need to sync accesses. diff --git a/string.c b/string.c index 8de906b..1377ea3 100644 --- a/string.c +++ b/string.c @@ -1378,8 +1378,13 @@ rb_str_free(VALUE str) https://github.com/ruby/ruby/blob/trunk/string.c#L1378 { 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)) { -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/