std.allocator ready for some abuse

Namespace rswhite4 at googlemail.com
Thu Oct 24 15:22:45 PDT 2013


On Thursday, 24 October 2013 at 21:58:36 UTC, Andrej Mitrovic 
wrote:
> 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).

That would be really awesome. I would test it immediately and 
extensively. :)


More information about the Digitalmars-d mailing list