std.allocator ready for some abuse

Vladimir Panteleev vladimir at thecybershadow.net
Thu Oct 24 14:31:12 PDT 2013


On Thursday, 24 October 2013 at 21:20:02 UTC, Andrei Alexandrescu 
wrote:
> The way I see that could be done is by defining a 
> ScopedAllocator that uses internally an AffixAllocator with a 
> doubly-linked list tracking all allocations. In the destructor, 
> ScopedAllocator would walk the list and deallocate everything 
> allocated since its construction.

Can this be generalized as a proxy allocator which simply 
implements deallocateAll, on top of its parent allocator's 
primitives?

The list can be singly-linked if random deallocation is not 
needed.


More information about the Digitalmars-d mailing list