Garbage collection
kinke
noone at nowhere.com
Sat Jun 27 16:03:12 UTC 2020
On Saturday, 27 June 2020 at 15:27:34 UTC, Stanislav Blinov wrote:
> On Saturday, 27 June 2020 at 14:12:09 UTC, kinke wrote:
>
>> Note that I explicitly clear the `str` slice before
>> GC.collect(), so that the stack shouldn't contain any refs to
>> the fat string anymore.
>
> Hrm... What happens if you call collect() twice?
Nothing changes, even when collecting 5 times at the end of each
iteration. In the filed testcase, I've extracted the stack ref to
a dedicated function, so that there really shouldn't be any refs
on the stack (this is unoptimized code after all...).
More information about the Digitalmars-d-learn
mailing list