summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-08-16 14:05:32 -0400
committerPeter Zhu <peter@peterzhu.ca>2023-08-17 15:53:00 -0400
commit5db8b9b366271fb2ec25ca76722a3d25a4bb7de7 (patch)
treec1137cae3fd2b48d17c3589fd137f8ae2d015a20 /test/ruby
parent52506cbf516da1a606fad6a6779ab6136c4f353b (diff)
Move total_freed_objects to size pool
This commit moves the `total_freed_objects` statistic to the size pool which allows for `total_freed_objects` key in `GC.stat_heap`.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/8231
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_gc.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index 7513aca46d..8d77e65bbe 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -165,6 +165,8 @@ class TestGc < Test::Unit::TestCase
assert_operator stat_heap[:force_major_gc_count], :>=, 0
assert_operator stat_heap[:force_incremental_marking_finish_count], :>=, 0
assert_operator stat_heap[:total_allocated_objects], :>=, 0
+ assert_operator stat_heap[:total_freed_objects], :>=, 0
+ assert_operator stat_heap[:total_freed_objects], :<=, stat_heap[:total_allocated_objects]
end
GC.stat_heap(0, stat_heap)
@@ -220,6 +222,7 @@ class TestGc < Test::Unit::TestCase
assert_equal stat[:total_allocated_pages], stat_heap_sum[:total_allocated_pages]
assert_equal stat[:total_freed_pages], stat_heap_sum[:total_freed_pages]
assert_equal stat[:total_allocated_objects], stat_heap_sum[:total_allocated_objects]
+ assert_equal stat[:total_freed_objects], stat_heap_sum[:total_freed_objects]
end
def test_latest_gc_info