RFC: moving forward with @nogc Phobos
Andrei Alexandrescu via Digitalmars-d
digitalmars-d at puremagic.com
Mon Sep 29 15:11:26 PDT 2014
On 9/29/14, 10:25 AM, Jacob Carlborg wrote:
> How does allocators fit in this? Will it be an additional argument to
> the function. Or a separate stack that one can push and pop allocators to?
There would be one allocator per thread (changeable) deferring to a
global interlocked allocator. Most algorithms would just use whatever
allocator is installed.
I know the notion of a thread-local and then global allocator is liable
to cause some an apoplexy attack. But it's time to model things as they
are - memory is a global resource and it ought to be treated as such. No
need to pass allocators around except for special cases.
Andrei
More information about the Digitalmars-d
mailing list