Feature #22135
closedRemove obsolete `ObjectSpace#_id2ref`
Description
As a result of [Feature #15408], the ObjectSpace#_id2ref method has been deprecated and now triggers a warning.
However, we recognize that its use had already been discouraged for a long time prior to this, and we believe it is rarely used nowadays.
Are there any objections to removing this method in version 4.1?
Updated by nobu (Nobuyoshi Nakada) 20 days ago
- Subject changed from Remove deprecated `ObjectSpace#_id2ref` to Remove obsolete `ObjectSpace#_id2ref`
Updated by byroot (Jean Boussier) 20 days ago
👍 this is a lot of complex and error prone code to support a deprecated feature. Very little gems ever used _id2ref and nowadays it's always advantageously replaced by a WeakMap.
Updated by jhawthorn (John Hawthorn) 18 days ago
+1 I would love to see this gone, we have to do a fair bit of work in the GC and elsewhere to maintain the id2ref table.
Updated by ko1 (Koichi Sasada) 13 days ago
+1
Updated by Eregon (Benoit Daloze) 13 days ago
+1
Updated by eightbitraptor (Matt V-H) 13 days ago
+1
Updated by nobu (Nobuyoshi Nakada) 11 days ago
- Status changed from Open to Closed
Applied in changeset git|df0622320bbd9a7c345e36e1b0730f25bc6a016b.
[Feature #22135] Remove obsolete ObjectSpace._id2ref
Updated by matz (Yukihiro Matsumoto) 10 days ago
Accepted.
_id2ref has been deprecated and it is fundamentally incompatible with the direction of the runtime (GC and Ractor). Reviving arbitrary objects from integer IDs was never a sound API. Let us remove it.
Matz.
Updated by headius (Charles Nutter) 3 days ago
I am very happy to see this go. Thanks everyone!