summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bootstraptest/test_ractor.rb9
-rw-r--r--ractor.c2
2 files changed, 9 insertions, 2 deletions
diff --git a/bootstraptest/test_ractor.rb b/bootstraptest/test_ractor.rb
index c587c2c1eb..797ad0a3ee 100644
--- a/bootstraptest/test_ractor.rb
+++ b/bootstraptest/test_ractor.rb
@@ -1149,6 +1149,14 @@ assert_equal '[:ok, false, false]', %q{
[(Ractor.make_shareable(x) rescue :ok), Ractor.shareable?(x), Ractor.shareable?(y)]
}
+# Ractor.make_shareable with Class/Module
+assert_equal '[C, M]', %q{
+ class C; end
+ module M; end
+
+ Ractor.make_shareable(ary = [C, M])
+}
+
# define_method() can invoke different Ractor's proc if the proc is shareable.
assert_equal '1', %q{
class C
@@ -1191,7 +1199,6 @@ assert_equal '[false, false, true, true]', %q{
r
}
-
# Ractor deep copies frozen objects (ary)
assert_equal '[true, false]', %q{
Ractor.new([[]].freeze) { |ary|
diff --git a/ractor.c b/ractor.c
index 180795b9c1..d2d4ee2e38 100644
--- a/ractor.c
+++ b/ractor.c
@@ -2396,7 +2396,7 @@ make_shareable_check_shareable(VALUE obj)
VM_ASSERT(!SPECIAL_CONST_P(obj));
bool made_shareable = false;
- if (RB_OBJ_SHAREABLE_P(obj)) {
+ if (rb_ractor_shareable_p(obj)) {
return traverse_skip;
}
else if (!frozen_shareable_p(obj, &made_shareable)) {