On Wednesday, 22 September 2021 at 11:44:16 UTC, Steven Schveighoffer wrote:
Once it's on the stack, the GC can see it for the full run of `main`. This is why this case is different.

Note that Java is even more aggressive, and might *still* collect it, because it could legitimately set `stopper` to null after the last use to signify that it's no longer needed.

And it follows that programming in GC-supporting languages
*may* be harder than in languages with manual memory
management, right?

Reply via email to