What should happen here?

IGotD- nise at nise.com
Mon Sep 20 19:13:19 UTC 2021


On Monday, 20 September 2021 at 19:00:38 UTC, IGotD- wrote:
>

I also think this doesn't have much to do with the GC of D but 
more a general life time behaviour. In Rust (feel free to kick me 
in butt every time I mention Rust), there the free call might 
happen after the variable is last being used and not necessarily 
at the end of scope. That behaviour would yield the same result 
that C functions would access invalid memory.

The only thing that saves Rust is that when you send a variables 
to C world, the compiler gives up, consider it gone and does 
nothing.

The next question would be, would the upcoming borrow checker in 
D solve any of this?




More information about the Digitalmars-d mailing list