summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2019-11-07 12:46:14 -0800
committerAaron Patterson <tenderlove@ruby-lang.org>2019-11-07 12:46:14 -0800
commitdddf5afb7947f5aba1ff875e9f5eb163f8c3d6c7 (patch)
tree54dad3b61f118d19b4ece146c1ff2d13d4ffd75b /test
parent597ec4354333573d69f57dad931cb8ef477d191a (diff)
Add a counter for compaction
Keep track of the number of times the compactor ran. I would like to use this as a way to keep track of inline cache reference updates.
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_gc_compact.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_gc_compact.rb b/test/ruby/test_gc_compact.rb
index bc26897386..e93e775279 100644
--- a/test/ruby/test_gc_compact.rb
+++ b/test/ruby/test_gc_compact.rb
@@ -54,4 +54,10 @@ class TestGCCompact < Test::Unit::TestCase
assert GC.compact
walk_ast ast
end
+
+ def test_compact_count
+ count = GC.stat(:compact_count)
+ GC.compact
+ assert_equal count + 1, GC.stat(:compact_count)
+ end
end