Project

General

Profile

Actions

Feature #22135

closed

Remove obsolete `ObjectSpace#_id2ref`

Feature #22135: Remove obsolete `ObjectSpace#_id2ref`
3

Added by nobu (Nobuyoshi Nakada) 20 days ago. Updated 3 days ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:125882]

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?

GH-17577

Updated by nobu (Nobuyoshi Nakada) 20 days ago Actions #1

  • Subject changed from Remove deprecated `ObjectSpace#_id2ref` to Remove obsolete `ObjectSpace#_id2ref`

Updated by byroot (Jean Boussier) 20 days ago 3Actions #2 [ruby-core:125888]

👍 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 Actions #3 [ruby-core:125917]

+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 nobu (Nobuyoshi Nakada) 11 days ago 1Actions #7

  • Status changed from Open to Closed

Applied in changeset git|df0622320bbd9a7c345e36e1b0730f25bc6a016b.


[Feature #22135] Remove obsolete ObjectSpace._id2ref

Updated by matz (Yukihiro Matsumoto) 11 days ago Actions #8 [ruby-core:126024]

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 Actions #9 [ruby-core:126117]

I am very happy to see this go. Thanks everyone!

Actions

Also available in: PDF Atom