mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
ca9733dc02
commit
41f5237ed1
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue