class
Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Superclass: ObjectSpace::WeakMap

On MRI `ObjectSpace::WeakMap` keys are weak references. So we can simply use WeakMap as a `Set`.


On TruffleRuby `ObjectSpace::WeakMap` keys are strong references. So we use `object_id` as a key and the actual object as a value.

JRuby for now doesn’t have Class#descendant, but when it will, it will likely have the same WeakMap semantic than Truffle so we future proof this as much as possible.

Show files where this class is defined (1 file)
Register or log in to add new notes.