Manual memory management in D2

Adam Ruppe destructionator at gmail.com
Tue Jul 13 15:22:03 PDT 2010


On 7/13/10, Nick Sabalausky <a at a.a> wrote:
> I think I'm missing something. Instead of regressing back to malloc & co.,
> why not just have the custom allocators?

For me, what I don't like is they are in the wrong place. If you use a
malloc/free custom allocator, that fact is hidden in the class.
There's no outward indication that you need to use care and delete it.
Also, if you have one class that you want to use in two separate ways,
the custom allocator doesn't do it.

Sometimes I want it manually, sometimes I want it automatic. The usage
site is where I want to make the decision, rarely in the class
definition.


More information about the Digitalmars-d mailing list