Manual memory management in D2

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Jul 14 00:25:12 PDT 2010


On 07/14/2010 01:15 AM, Kagamin wrote:
> Andrei Alexandrescu Wrote:
>
>> most GC's cannot provide efficient manual reclamation. And they
>> shouldn't anyway.
>>
> If one doesn't want to implement a function, he can throw
> NotImplementedException, or don't provide the function so that
> program using the delete won't link.

And how would you use such a feature effectively? I've seen such
"optional implementation" policies in standards such as SQL 
(compatibility levels) and C++ (export). They _always_ fare disastrously.

> But deallocation of allocated
> memory is not that unthinkable just because it can be hard.

It's not about difficulty as much as constraining GC implementers 
unnecessarily. Again: use a heap tuned for manual management to manage 
memory manually, and a heap tuned for automatic management to manage 
memory automatically. I think it's a very reasonable stance.


Andrei


More information about the Digitalmars-d mailing list