Two little blog/tutorials posts.

Regan Heath regan at netwin.co.nz
Mon Feb 27 19:23:13 PST 2006


On Tue, 28 Feb 2006 16:15:38 +1300, Regan Heath <regan at netwin.co.nz> wrote:
> D is garbage collected and the collector does not guarantee to call the  
> destructor for the File object. So, the above code may never close the  
> file.

Which reminds me, your other statement in the first article:

"memory management (autofreeing at the end of each function) - so you dont  
need to splatter the code with malloc)(/free()"

should probably mention the garbage collector as the reason you don't need  
malloc/free.

The statement:
   "autofreeing at the end of each function"

isn't exactly true, the current GC tends to free when resources get tight,  
i.e. you ask for more memory and there isn't enough.

Regan



More information about the Digitalmars-d-learn mailing list