std.allocator ready for some abuse

Andrej Mitrovic andrej.mitrovich at gmail.com
Thu Oct 24 14:58:27 PDT 2013


On 10/24/13, Namespace <rswhite4 at googlemail.com> wrote:
> A dream of me, that will probably never come true, would be also
> something like this:
> ----
> with (Mallocator) {
>      int[] arr;
>      arr ~= 42; /// will use Mallocator.it.allocate internal
> }
> ----
>

Actually this got me thinking..

import core.memory;

GC.useAllocator!Mallocator;
int[] arr;
arr ~= 42;

This could be a useful test-bed for the allocators by using them with
existing D applications and libraries that depend on the GC (most apps
I'd assume).


More information about the Digitalmars-d mailing list