From 41f5237ed19d5e8d471d441e2cbfc3063f58b110 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Tue, 9 Apr 2019 20:47:36 +0000 Subject: Try to make compaction more likely This commit tries to make compaction more likely by allocating some objects and then throwing them away git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_gc_compact.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/ruby/test_gc_compact.rb') diff --git a/test/ruby/test_gc_compact.rb b/test/ruby/test_gc_compact.rb index 888f0ad96e..784eb07a43 100644 --- a/test/ruby/test_gc_compact.rb +++ b/test/ruby/test_gc_compact.rb @@ -23,7 +23,11 @@ class TestGCCompact < Test::Unit::TestCase end def big_list - 1000.times.map { Object.new } # likely next to each other + 1000.times.map { + # try to make some empty slots by allocating an object and discarding + Object.new + Object.new + } # likely next to each other end # Find an object that's allocated in a slot that had a previous -- cgit v1.2.3