diff options
author | Peter Zhu <peter@peterzhu.ca> | 2023-12-08 15:18:07 -0500 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2023-12-12 09:01:21 -0500 |
commit | 185b7e92a37548255fcc8c5ab08b72abeadaf74e (patch) | |
tree | 9777b65e5f44b765c4ba9634c1011aad44b6e4b7 /test | |
parent | 33cf8f640bab35c463186ef0856689c22559fbeb (diff) |
Make WeakKeyMap safe for compaction during allocation
During allocation, the table may not have been allocated yet which would
crash in the st_foreach.
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_weakkeymap.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_weakkeymap.rb b/test/ruby/test_weakkeymap.rb index be3e80cec4..799cee2d75 100644 --- a/test/ruby/test_weakkeymap.rb +++ b/test/ruby/test_weakkeymap.rb @@ -123,6 +123,10 @@ class TestWeakKeyMap < Test::Unit::TestCase end; end + def test_gc_compact_stress + EnvUtil.under_gc_compact_stress { ObjectSpace::WeakKeyMap.new } + end + private def assert_weak_include(m, k, n = 100) |