summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-10-20 17:28:12 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-12-14 19:19:16 +0900
commit65450e8f7daf59ca64a12ff1da0efdc0f4280dc1 (patch)
treec9a7db9aad84e42b68ddeb7a32eba27ce7b2a607 /vm.c
parentf43c71abe07b4b2b0f8f9a69c567fcd0f38faef6 (diff)
Call FrozenCore.make_shareable
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3681
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index c6f3344..8ced733 100644
--- a/vm.c
+++ b/vm.c
@@ -3177,6 +3177,12 @@ m_core_hash_merge_kwd(VALUE recv, VALUE hash, VALUE kw)
}
static VALUE
+m_core_make_shareable(VALUE recv, VALUE obj)
+{
+ return rb_obj_freeze(obj);
+}
+
+static VALUE
core_hash_merge_kwd(VALUE hash, VALUE kw)
{
rb_hash_foreach(rb_to_hash_type(kw), kwmerge_i, hash);
@@ -3340,6 +3346,7 @@ Init_VM(void)
rb_define_method_id(klass, id_core_raise, f_raise, -1);
rb_define_method_id(klass, idProc, f_proc, 0);
rb_define_method_id(klass, idLambda, f_lambda, 0);
+ rb_define_method(klass, "make_shareable", m_core_make_shareable, 1);
rb_obj_freeze(fcore);
RBASIC_CLEAR_CLASS(klass);
rb_obj_freeze(klass);