On Thursday, 23 September 2021 at 12:53:14 UTC, Steven Schveighoffer wrote:
Show me these rules!

They are here: https://dlang.org/spec/interfaceToC.html#storage_allocation

With the caveat, of course, that the recommendation to "leave a pointer on the stack" is not as easy to follow as one might think with the optimizer fighting against that.

Yes, as you explained me, the root of the
problem in my examples were dead store elimination.

We need to add a better way to do that (similar to C# KeepAlive).

Do you mean some function attribute?..

Reply via email to