On Thursday, 24 October 2013 at 22:22:53 UTC, Namespace wrote:
On Thursday, 24 October 2013 at 21:58:36 UTC, Andrej Mitrovic
wrote:
On 10/24/13, Namespace <rswhi...@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. :)
Another idea would be that every built-in array has a Allocator
property which can be set:
----
int[] arr;
arr.allocator = Mallocator;
----