Skip to content

Commit

Permalink
Revert debugging code in test_gc_compact.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
peterzhu2118 committed Jun 6, 2023
1 parent c3dc9fc commit fae2f80
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions test/ruby/test_gc_compact.rb
Expand Up @@ -422,23 +422,19 @@ def test_moving_hashes_down_size_pools
# 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)
assert_separately(%w[-robjspace], "#{<<~"begin;"}\n#{<<~"end;"}", timeout: 10, signal: :SEGV)
begin;
HASH_COUNT = 500
GC.verify_compaction_references(expand_heap: true, toward: :empty)
before_read_barrier_faults = GC.stat(:read_barrier_faults)
base_hash = { a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8 }
ary = HASH_COUNT.times.map { base_hash.dup }
ary.each { |h| h[:i] = 9 }
before_stat_heap = GC.stat_heap
stats = GC.verify_compaction_references(expand_heap: true, toward: :empty)
after_stat_heap = GC.stat_heap
assert_operator(stats[:moved_down][:T_HASH], :>=, 500, "read barrier faults: before #{before_read_barrier_faults}, after #{GC.stat(:read_barrier_faults)}, stat_heap: before #{before_stat_heap}, after: #{after_stat_heap}, stats: #{stats}")
assert_operator(stats[:moved_down][:T_HASH], :>=, 500)
end;
end

Expand Down

0 comments on commit fae2f80

Please sign in to comment.