Let's get the semantic around closure fixed.

deadalnix deadalnix at gmail.com
Sun May 30 21:09:36 UTC 2021


On Friday, 28 May 2021 at 14:29:50 UTC, Paul Backus wrote:
> `ldc -O` is able to elide the allocation: 
> <https://d.godbolt.org/z/9aoMo9hbe>
>
> However, the code still does not qualify as `@nogc`, because 
> `@nogc` analysis is done prior to optimization.

I've long argued that nogc needs to trigger n leaks, not 
allocations, and this is one more example as to why.

And tracking leak isn't as crazy as it sound whn you track 
ownership, a leak is a transfers of ownership to the GC.



More information about the Digitalmars-d mailing list