diff options
author | Rohit Menon <[email protected]> | 2021-07-07 23:13:49 -0400 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2021-12-15 15:04:34 +0900 |
commit | 3aab870761ff0138ffd29e0a08b6cdf151e2acb4 (patch) | |
tree | 21cc313360f3736a752987ec69699a13dd73aed1 | |
parent | e071ac8b3db80901566882ae82a9ba75106995da (diff) |
Make ENV shareable
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5263
-rw-r--r-- | hash.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -44,6 +44,7 @@ #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) 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); |