summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2021-03-12 19:36:58 +0000
committerPeter Zhu <peter@peterzhu.ca>2021-03-24 14:31:10 -0400
commitb25361f7319cac953145d9d15e2e673e560ec3d9 (patch)
tree6df9c6dba3398bb5fb6bb429ddec632512160b0b /test
parentf9f13a4f6d8be706b17efc089c28f7bc617ef549 (diff)
Change heap walking to be safe for object allocation
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4263
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_objectspace.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_objectspace.rb b/test/ruby/test_objectspace.rb
index 02c20aa261..b48fbc1c15 100644
--- a/test/ruby/test_objectspace.rb
+++ b/test/ruby/test_objectspace.rb
@@ -233,4 +233,11 @@ End
assert_kind_of(meta, sclass)
assert_include(ObjectSpace.each_object(meta).to_a, sclass)
end
+
+ def test_each_object_with_allocation
+ assert_normal_exit(<<-End)
+ list = []
+ ObjectSpace.each_object { |o| list << Object.new }
+ End
+ end
end