Rant of the day
Rumbu
rumbu at rumbu.ro
Tue Jan 26 17:06:41 UTC 2021
On Tuesday, 26 January 2021 at 15:16:01 UTC, Steven Schveighoffer
wrote:
> On 1/25/21 9:55 PM, rikki cattermole wrote:
>
>> Note: you did not need to call GC.free. The destroy would have
>> guaranteed unmapping internally. GC.free would only remove the
>> class instance memory itself.
>
> This. GC is for memory cleanup, but not necessary to cleanup
> resources.
>
> If you are calling GC.free in your code, likely you are doing
> something wrong.
>
> -Steve
I took the example from an unittest, assuming that people writing
phobos libs are way smarter than me :)
https://github.com/dlang/phobos/blob/fb7bfb2ba5a581cafb9e85ced8f8d67aab35f412/std/mmfile.d#L673
More information about the Digitalmars-d
mailing list