News for hackers. Stuff that matters.
Re:Conservative GC can be faster than precise GC by sltkr on Saturday September 07, 2024 @03:51PM (#41476021)
That's not what precise GC means.

Precise means that on a GC cycle, only true pointers to heap allocated objects are identified as roots, which means that an unreferenced object cannot be kept alive by a value that happens to have a similar bit pattern as a heap pointer. This guarantees that unreferenced objects are eventually cleaned up, but not that this cleanup happens immediately, certainly not as part of a busy loop. (Unless the system runs out of memory, but in that case, a GC iteration is required anyway.)

Re:Conservative GC can be faster than precise GC by vlovich123 on Saturday September 07, 2024 @04:10PM (#41476166)
Since reference counting is GC, isn't reference counting a form of precise GC? That's certainly the scenario I had in mind reading what OP wrote where deallocation within a hot loop would be possible.
Re:Conservative GC can be faster than precise GC by hinkley on Saturday September 07, 2024 @04:30PM (#41476289)
No it’s usually called conservative unless you have loop detection.
Re:Conservative GC can be faster than precise GC by hinkley on Saturday September 07, 2024 @04:34PM (#41476304)
Oof. We used to just call that tracing.
Re:Conservative GC can be faster than precise GC by chrsig on Saturday September 07, 2024 @04:46PM (#41476371)
i think it is still tracing, it's just a matter of identifying possible roots versus actual roots and constraints that fall out from that.
Re:Conservative GC can be faster than precise GC by ordu on Saturday September 07, 2024 @10:12PM (#41477721)
Tracing is the technique to find all alive objects from roots. You dereference a pointer to find there some object, and then to recursively iterate over pointers in that object. But before that you need to choose what to use as roots, and here is a difference: you can be precise with choosing the roots, or to err on a conservative side, choosing more roots than you actually need.
Re:Conservative GC can be faster than precise GC by hinkley on Sunday September 08, 2024 @02:29PM (#41482121)
That is too subtle of a distinction. Tracing demands roots. Why are we inventing a new classification where we have accurate versus inaccurate roots?
Re:Conservative GC can be faster than precise GC by ordu on Monday September 09, 2024 @08:20AM (#41487828)
This classification was invented decades ago. I think in 1970s or even earlier. Garbage collection is a large field with lots of ideas and research behind it. There are different approaches to structure the heap, to find roots, to trace living objects. These different approaches oftentimes (but not always) replaceable, you can change how you find roots while leaving other things intact.

GC is a large field, it has its own terminology, and instead of asking "why are we inventing terminology", I'd ask "who we are to change the existing terminology".