Miscellaneous memory management questions

Peter Alexander peter.alexander.au at gmail.com
Fri Sep 3 02:44:31 PDT 2010


== Quote from Simen kjaeraas (simen.kjaras at gmail.com)'s article
> Peter Alexander <peter.alexander.au at gmail.com> wrote:
> > 1. How do I disable the GC?
> In a way, you don't. You can, however, replace it with a stub GC.

Cool. So the stub GC does nothing and has no overhead?


> > 4. Any plans for allocators?
> None of which I know. D should easily support building your own,
though.
> Of course, such a construct would then only be supported by your
own
> classes.

That's the problem though; if I write my own allocators then no
one knows about them. I won't be able to use them with the
standard library, so I'll have to rewrite all parts of the
standard library that allocate memory (i.e. all the containers).
What's worse, if I use some other 3rd-party library then it will
use it's own allocators, which will probably be incompatible with
mine.

The whole point of a standard library is to provide a good set of
common components that application and library developers can
agree to build upon. If D is supposed to be a systems programming
language, then I would expect allocators to be included in the
standard library.


> > 5. Does Phobos rely on a GC?
> Parts of it, certainly.

See above.


More information about the Digitalmars-d mailing list