Sorry for replying to my own post, can somebody confirm please that
the following code proves that Array#shift does not leak?
Thx in advance
def count
i = 0
ObjectSpace.each_object{ i += 1 }
i
end
a = []
10.times do
10_000.times do
a << "a"
a.shift
end
ObjectSpace.garbage_collect
p count
end
381
382
382
382
382
382
382
382
382
382
Robert