GC doesn't collect where expected
Anonymouse
zorael at gmail.com
Mon Jun 19 16:51:29 UTC 2023
On Monday, 19 June 2023 at 16:43:30 UTC, Steven Schveighoffer
wrote:
>
> In this specific case, most likely it's a stale register or
> stack reference. One way I usually use to ensure such things is
> to call a function that destroys the existing stack:
>
> ```d
> void clobber()
> {
> int[2048] x;
> }
> ```
>
> Calling this function will clear out 2048x4 bytes of data to 0
> on the stack.
>
> -Steve
Could you elaborate on how you use this? When do you call it?
Just, ever so often, or is there thought behind it?
More information about the Digitalmars-d-learn
mailing list