summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authorNARUSE, Yui <naruse@airemix.jp>2021-03-02 18:27:43 +0900
committerNARUSE, Yui <naruse@airemix.jp>2021-03-02 18:27:43 +0900
commit713d6d5eb05de06a0de25feef801ff8c72c65754 (patch)
treea5024f0cd933ae62fe43eb9ae690bf426c3d7df7 /random.c
parent5816725ccc9642101d447b0f3b03c14d232aec6a (diff)
merge revision(s) 265c0022390e3dcd4ff692fc77d29b94e652c877: [Backport #17653]
Do not allocate ractor-local storage in dfree function during GC --- random.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Diffstat (limited to 'random.c')
-rw-r--r--random.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/random.c b/random.c
index 61de6bc7aa..7567d13dd7 100644
--- a/random.c
+++ b/random.c
@@ -261,7 +261,8 @@ const rb_data_type_t rb_random_data_type = {
static void
random_mt_free(void *ptr)
{
- if (ptr != default_rand())
+ rb_random_mt_t *rnd = rb_ractor_local_storage_ptr(default_rand_key);
+ if (ptr != rnd)
xfree(ptr);
}