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) about 1 month ago
- Subject changed from Remove deprecated `ObjectSpace#_id2ref` to Remove obsolete `ObjectSpace#_id2ref`
Updated by byroot (Jean Boussier) about 1 month 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) about 1 month 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) about 1 month ago
+1
Updated by Eregon (Benoit Daloze) about 1 month ago
+1
Updated by eightbitraptor (Matt V-H) about 1 month ago
+1
Updated by nobu (Nobuyoshi Nakada) about 1 month ago
- Status changed from Open to Closed
Applied in changeset git|df0622320bbd9a7c345e36e1b0730f25bc6a016b.
[Feature #22135] Remove obsolete ObjectSpace._id2ref
Updated by matz (Yukihiro Matsumoto) about 1 month 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) 26 days ago
I am very happy to see this go. Thanks everyone!