
Gregory Peele ARA/CFD escribió:
In favor of garbage collection in general, though - for some use cases, especially those that don't use non-memory resources, it makes a lot of sense. The Boehm guys claim that garbage collection can be a significant performance win for workloads involving large numbers of small objects, as compared to C++ new / delete - especially in multithreaded environments.
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. My point behind this is: you can have memory management as fast as any GC can achieve and still retain RAII style. No need to force users to resort to GC for performance's sake. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo