
21 Apr
2009
21 Apr
'09
4:54 p.m.
joaquin@tid.es wrote:
AFAICS, you can have an implementation of delete where "delete p" simply calls the destructor of the object pointed to by p and then passes p to an internal garbage collector that will reclaim the memory in due time. This way you have determinstic resource liberation *and* GC speed.
Actually, that would be faster. If you use mark & sweep, RAII gives you mark (which requires reachability analysis in normal GC scenarios) for free.