Manual Deletion from Destructor

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Sat Mar 14 11:19:19 PDT 2009


BCS wrote:
> Hello dsimcha,
> 
>> I sometimes run into false pointer issues when using very large data
>> structures in D.  Often, these data structures are owned by a single
>> class instance and do not escape.  In these cases, is it safe to do
>> something like:
>>
> 
> If you can be shure ~this will get called, you might switch to malloc.

If you do this, don't forget to register and unregister the memory with 
the GC if it contains any pointers into GC-allocated data. Otherwise, 
the GC won't see those pointers and may delete that data if there aren't 
any other references to it.



More information about the Digitalmars-d mailing list