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

ruby-changes:64496

From: Koichi <ko1@a...>
Date: Wed, 23 Dec 2020 13:40:26 +0900 (JST)
Subject: [ruby-changes:64496] 7e44ade565 (master): ruby_single_main_ractor should be clear before warn

https://git.ruby-lang.org/ruby.git/commit/?id=7e44ade565

From 7e44ade5658bc6ae16e9838c64ff9e90d4fd805e Mon Sep 17 00:00:00 2001
From: Koichi Sasada <ko1@a...>
Date: Wed, 23 Dec 2020 13:34:11 +0900
Subject: ruby_single_main_ractor should be clear before warn

rb_warn can produce T_HASA object and it should not use
transient heap.

diff --git a/ractor.c b/ractor.c
index a4ece10..7675a09 100644
--- a/ractor.c
+++ b/ractor.c
@@ -1386,13 +1386,13 @@ cancel_single_ractor_mode(void) https://github.com/ruby/ruby/blob/trunk/ractor.c#L1386
     rb_gc_start();
     rb_transient_heap_evacuate();
 
+    ruby_single_main_ractor = NULL;
+
     if (rb_warning_category_enabled_p(RB_WARN_CATEGORY_EXPERIMENTAL)) {
         rb_category_warn(RB_WARN_CATEGORY_EXPERIMENTAL,
                          "Ractor is experimental, and the behavior may change in future versions of Ruby! "
                          "Also there are many implementation issues.");
     }
-
-    ruby_single_main_ractor = NULL;
 }
 
 static void
-- 
cgit v0.10.2


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

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