Custom Allocators

James Miller james at aatch.net
Mon Apr 2 20:47:53 PDT 2012


I've been doing some reading on dlang.org and the newsgroup archives
and have seen talk about allocators and things around the garbage
collector.

I have a few questions about the entire thing:

- I understand that allocators are all about memory management, but
how does this affect D and the way allocators are integrated into the
language?
- How are allocators supposed to work with the GC? I know that you can
manually allocate memory and add the range to the GC, but why do you
have to do this?
- I've read that custom allocators aren't implemented, but I see
references to using new() and delete() in classes in the docs? Is this
one of the cases where the docs are "what it should be" and the
reality is different? If there aren't custom allocators, then are
there any major blockers to the addition (or is it just "because
nobody has added it"?)?
- Would it be possible to use custom allocators to write a completely
GC-free application (using ref-counting instead for example)? Or would
the GC still be used anyway?

If I'm way off base on anything, feel free to say so, memory
management and garbage collection aren't exactly my strong suits.

Thanks

--
James Miller


More information about the Digitalmars-d-learn mailing list