Rubyists: stop using ObjectSpace._id2ref! It's not even safe to use on MRI/CRuby because it tries to reconstitute objects based on a pointer address in the GC heap (obj.object_id). JRuby does not support it out of the box.
Can you say more about how it's broken? It doesn't sound any different than having a pointer in C
-
-
It's a pointer into the heap, which will get reused after the object has been collected. It's eventually not going to point at what you think it points at. And making it safe requires an expensive ID to object weak map (enabled in JRuby via a flag) so it will never work well.
-
Verifies my suspicions about the implications.
- 8 more replies
New conversation -
-
-
I suspect it makes subsystems more complex as the id cannot be a physical ref due object moves between generations, so tracking has overhead (runtime and complexity).
-
But I'm not at all authoritative here, I gladly stay away from ruby implementation details whenever I can.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.