1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2021-03-27 13:02:41 +01:00
parent 44736a6b7a
commit 95d9fe9538
26 changed files with 501 additions and 84 deletions

View file

@ -13,9 +13,11 @@ class WeakRefSpec
def self.make_dead_weakref
weaks = []
weak = nil
10_000.times do
1000.times do
weaks << make_weakref
GC.start
end
1000.times do
GC.start
break if weak = weaks.find { |w| !w.weakref_alive? }
end