Re:Friendship ended with the garbage collector
by zozbot234 on Friday August 27, 2021 @05:09AM
(#28325704)
You can use arenas for the cases where you really can't do without delayed/batched deallocation. But deterministic deallocation as provided by RC is a very good default for many cases, including where low-latency is a goal.
Re:Friendship ended with the garbage collector
by p_l on Friday August 27, 2021 @07:20AM
(#28326375)
RC is not deterministic. That's the whole thing - when you free a refcounted object, you do not deterministically know how long is it going to take, and on systems that try to avoid RC-induced pauses, you don't get to know when the memory is going to be released.
If you want to talk determinism, you need to actually invest into deterministic behaviour - something that either requires dropping dynamic memory allocation altogether, or tends to go for GC with known determinism guarantees (for example, IBM Metronome).
Re:Friendship ended with the garbage collector
by raverbashing on Friday August 27, 2021 @03:33AM
(#28325273)
Well, naive code is going to suck, be it RC or GC
> And despite what some people think, malloc/free are not O(1) free lunch
Of course. Be it through a GC allocator or not. If you're at the point where the allocator is giving you trouble then GC/RC is the least of your problems ;)
And despite what some people think, malloc/free are not O(1) free lunch.