Re: Allocators stack

2014-12-23 Thread Allocator stack via Digitalmars-d
On Monday, 22 December 2014 at 21:09:21 UTC, Meta wrote: There are only a couple of constructs in D that allocate, so it may be worthwhile to let the allocator control the primitives, i.e.: auto gc = new GCAllocator(...); gc.Array!char a = ['x', 'y']; a ~= ['a', 'b']; //use

Re: Allocators stack

2014-12-23 Thread Allocator stack via Digitalmars-d
Walter's DIP: Region Based Memory Allocation http://wiki.dlang.org/DIP46 Sandboxes for stateless programing

Allocators stack

2014-12-22 Thread Allocator stack via Digitalmars-d
How about allocators stack? Allocator e.g. one of these https://github.com/andralex/phobos/blob/allocator/std/allocator.d - allocatorStack.push(new GCAllocator); //Some code that use memory allocation auto a = ['x', 'y']; a ~= ['a', 'b']; // use allocatorStack.top.realloc(...);