From cea9c30fa549885e36471f1782359df2bdcf895a Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 19 Apr 2023 16:16:27 -0400 Subject: Move ar_hint to ar_table_struct This allows Hashes with ST tables to fit int he 80 byte size pool. --- test/ruby/test_gc_compact.rb | 3 ++- test/ruby/test_shapes.rb | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'test') 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) -- cgit v1.2.1