summaryrefslogtreecommitdiff
path: root/test/ruby/test_gc_compact.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-09 20:47:36 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-09 20:47:36 +0000
commit41f5237ed19d5e8d471d441e2cbfc3063f58b110 (patch)
treefef104b3d7403026f049469ce26418643f542028 /test/ruby/test_gc_compact.rb
parentca9733dc02213211a4e6fd767195cd7de36762c0 (diff)
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
Diffstat (limited to 'test/ruby/test_gc_compact.rb')
-rw-r--r--test/ruby/test_gc_compact.rb6
1 files changed, 5 insertions, 1 deletions
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