Re:Reclaiming C++ Data Structures with Cycles
by dmitrygr on Thursday October 13, 2016 @08:40AM
(#12700305)
I did. You wanted acknowledgement that there are problems for which GC is best solution in C++. I explained why it is never best and likely never anything beyond "barely acceptable".
[ Parent
| on HN ]
Re:Reclaiming C++ Data Structures with Cycles
by ingenter on Thursday October 13, 2016 @08:44AM
(#12700329)
Do you understand that the linked article, and the talk referenced in the article describe a way to implement garbage collection as a solution to (memory management for) data structures with cycles?
Do you think that this problem is not equivalent to "how do I allow my dog to make a 'press this button for fart sound' app?"?
Do you have a better solution to reclaiming data structures with cyclic pointers?
Re:Reclaiming C++ Data Structures with Cycles
by palunon on Thursday October 13, 2016 @10:39AM
(#12701035)
Pool allocation, and delete the whole thing at the end.
Of course, sometimes (most times ?) you can't do this, and you really need a GC.
There is a reason why TAOCP spends a whole chapter on GC IIRC...