On Wednesday, 9 July 2014 at 14:36:37 UTC, Marc Schütz wrote:
This could also be done at the allocator level, though.
An allocator presumably knows whether it's objects are garbage
collected (hmm... maybe not necessarily?), and it can inspect
types to find out whether they have destructors.
I think the advantage of using a region allocator would be to
allocate and clean up quickly without any extra overhead beyond
moving a pointer, but I guess new() could globally be restricted
to classes that does not provide a destructor…