diff options
author | Peter Zhu <[email protected]> | 2023-04-19 16:16:27 -0400 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2023-05-17 09:19:40 -0400 |
commit | cea9c30fa549885e36471f1782359df2bdcf895a (patch) | |
tree | b004d05c75af965c0bd4202f3ddcbe0b04de895c /test | |
parent | 0938964ba1af3924cf969fb809fc3598892bc20d (diff) |
Move ar_hint to ar_table_struct
This allows Hashes with ST tables to fit int he 80 byte size pool.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7742
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_gc_compact.rb | 3 | ||||
-rw-r--r-- | test/ruby/test_shapes.rb | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/test/ruby/test_gc_compact.rb b/test/ruby/test_gc_compact.rb index b1b964589a..221ca677e3 100644 --- a/test/ruby/test_gc_compact.rb +++ b/test/ruby/test_gc_compact.rb @@ -419,6 +419,8 @@ class TestGCCompact < Test::Unit::TestCase def test_moving_hashes_down_size_pools omit if GC::INTERNAL_CONSTANTS[:SIZE_POOL_COUNT] == 1 + # AR and ST hashes are in the same size pool on 32 bit + omit unless RbConfig::SIZEOF["uint64_t"] <= RbConfig::SIZEOF["void*"] assert_separately(%w[-robjspace], "#{<<~"begin;"}\n#{<<~"end;"}", timeout: 10, signal: :SEGV) begin; @@ -433,7 +435,6 @@ class TestGCCompact < Test::Unit::TestCase stats = GC.verify_compaction_references(expand_heap: true, toward: :empty) assert_operator(stats[:moved_down][:T_HASH], :>=, HASH_COUNT) - assert_include(ObjectSpace.dump(ary[0]), '"slot_size":' + GC::INTERNAL_CONSTANTS[:BASE_SLOT_SIZE].to_s) end; end diff --git a/test/ruby/test_shapes.rb b/test/ruby/test_shapes.rb index d9cce4a337..ebc94a12d2 100644 --- a/test/ruby/test_shapes.rb +++ b/test/ruby/test_shapes.rb @@ -373,6 +373,8 @@ class TestShapes < Test::Unit::TestCase end def test_hash_has_correct_pool_shape + omit "SHAPE_IN_BASIC_FLAGS == 0" unless RbConfig::SIZEOF["uint64_t"] <= RbConfig::SIZEOF["void*"] + # All hashes are now allocated their own ar_table, so start in a # larger pool, and have already transitioned once. assert_shape_equal(RubyVM::Shape.root_shape, RubyVM::Shape.of({}).parent) |