How to use destroy and free.

forkit forkit at gmail.com
Wed May 4 21:46:50 UTC 2022


On Wednesday, 4 May 2022 at 12:57:26 UTC, Ali Çehreli wrote:
> On 5/3/22 22:37, forkit wrote:
>
> > In any case, I disagree that caring about when memory gets
> deallocted
> > means you shouldn't be using GC. (or did I get that one wrong
> too??)
>
> At least I don't agree with you there. :) Yes, one should not 
> care about how memory gets freed if one did not care how that 
> memory was allocated.
> ....

That languages with GC typically give the programmer some control 
over the GC, is evidence that programmers do care (otherwise such 
features would not be needed).

To deny a programmer the option to release the memory that was GC 
allocated within a particular scope, to be release immediately 
after that scope exits, seems kinda cruel.

To force a programmer to run a full GC in such a situation, is 
also kinda cruel.

To force a programmer back to using the ancient malloc/free.... 
well.. that's even crueler.




More information about the Digitalmars-d-learn mailing list