News for hackers. Stuff that matters.
Re:Fundamentals of Garbage Collection by louthy on Saturday July 12, 2025 @03:11AM (#44539978)
On any one object you can just follow the references to see if you get back to the same object. Not super efficient as you’d have to do it for each reference as it is set.

But if it was a simple scripting language and you needed that constraint, it’s relativity easy to implement.

Re:Fundamentals of Garbage Collection by Findecanor on Saturday July 12, 2025 @09:48AM (#44542059)
That would still be tracing. The problem is that if there is a cycle, the reference count would be too high, and you'd not detect that the object should be reclaimed.
Re:Fundamentals of Garbage Collection by louthy on Tuesday July 15, 2025 @02:41AM (#44568493)
I was replying to the OP:

> "but I was recently wondering if it would be possible to detect and deny pointer cycles in a language in an efficient way"

...not whatever issue you are worried about.