Skip to content

Commit

Permalink
Make ENV shareable
Browse files Browse the repository at this point in the history
  • Loading branch information
rm155 authored and ko1 committed Dec 15, 2021
1 parent e071ac8 commit 3aab870
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hash.c
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3aab870

Please sign in to comment.