[前][次][番号順一覧][スレッド一覧]

ruby-changes:65194

From: Nobuyoshi <ko1@a...>
Date: Tue, 9 Feb 2021 01:02:23 +0900 (JST)
Subject: [ruby-changes:65194] 265c002239 (master): Do not allocate ractor-local storage in dfree function during GC

https://git.ruby-lang.org/ruby.git/commit/?id=265c002239

From 265c0022390e3dcd4ff692fc77d29b94e652c877 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 9 Feb 2021 01:00:00 +0900
Subject: Do not allocate ractor-local storage in dfree function during GC

---
 random.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/random.c b/random.c
index c11cd80..83df6d1 100644
--- a/random.c
+++ b/random.c
@@ -263,7 +263,8 @@ const rb_data_type_t rb_random_data_type = { https://github.com/ruby/ruby/blob/trunk/random.c#L263
 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);
 }
 
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]