Open jaynetics opened 4 years ago
it seems as if in some, but not all of the error cases, a memoized value leaks over from another object:
require 'mize'
class Thing
memoize method:
def val
Object.new
end
end
arrays = []
2000.times { Thread.new { t = Thing.new; arrays << [t.val, t.val] } }
good, bad = arrays.partition { |arr| arr.uniq.count == 1 }
[good.count, bad.count] # => [1998, 2]
bad.flatten.map { |v| good.flatten.include?(v) } # => [false, true, false, false]
maybe related: https://github.com/flori/tins/issues/21