class ActiveSupport::DescendantsTracker::WeakSet
:nodoc:
have the same WeakMap semantic than Truffle so we future proof this as much as possible.
JRuby for now doesn’t have Class#descendant, but when it will, it will likely
So we use ‘object_id` as a key and the actual object as a value.
On TruffleRuby `ObjectSpace::WeakMap` keys are strong references.
def [](object)
def [](object) @map.key?(object.object_id) end
def []=(object, _present)
def []=(object, _present) @map[object.object_id] = object end
def initialize
have the same WeakMap semantic than Truffle so we future proof this as much as possible.
JRuby for now doesn't have Class#descendant, but when it will, it will likely
So we use `object_id` as a key and the actual object as a value.
On TruffleRuby `ObjectSpace::WeakMap` keys are strong references.
def initialize @map = ObjectSpace::WeakMap.new end