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

ruby-changes:70223

From: Rohit <ko1@a...>
Date: Wed, 15 Dec 2021 15:04:57 +0900 (JST)
Subject: [ruby-changes:70223] 3aab870761 (master): Make ENV shareable

https://git.ruby-lang.org/ruby.git/commit/?id=3aab870761

From 3aab870761ff0138ffd29e0a08b6cdf151e2acb4 Mon Sep 17 00:00:00 2001
From: Rohit Menon <rohitmenon@v...>
Date: Wed, 7 Jul 2021 23:13:49 -0400
Subject: Make ENV shareable

---
 hash.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hash.c b/hash.c
index 9622663dc5e..58a775f8533 100644
--- a/hash.c
+++ b/hash.c
@@ -44,6 +44,7 @@ https://github.com/ruby/ruby/blob/trunk/hash.c#L44
 #include "symbol.h"
 #include "transient_heap.h"
 #include "ruby/thread_native.h"
+#include "ruby/ractor.h"
 
 #ifndef HASH_DEBUG
 #define HASH_DEBUG 0
@@ -7285,6 +7286,8 @@ Init_Hash(void) https://github.com/ruby/ruby/blob/trunk/hash.c#L7286
     origenviron = environ;
     envtbl = rb_obj_alloc(rb_cObject);
     rb_extend_object(envtbl, rb_mEnumerable);
+    FL_SET_RAW(envtbl, RUBY_FL_SHAREABLE);
+
 
     rb_define_singleton_method(envtbl, "[]", rb_f_getenv, 1);
     rb_define_singleton_method(envtbl, "fetch", env_fetch, -1);
-- 
cgit v1.2.1


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

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