Rant of the day
Steven Schveighoffer
schveiguy at gmail.com
Tue Jan 26 17:57:09 UTC 2021
On 1/26/21 12:06 PM, Rumbu wrote:
> 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.
>>
>
> 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
https://github.com/dlang/phobos/pull/7770
-Steve
More information about the Digitalmars-d
mailing list