new DIP38: Safe references and rvalue references without runtime checks.

Timothee Cour thelastmammoth at gmail.com
Mon May 6 15:41:43 PDT 2013


> Awfully put. I meant: this or any scheme based on internal (non-explicit)
> annotation for functions cannot work without triggering inter-procedural
> analysis. (I haven't read the DIP yet.)

The proposed scheme doesn't require any inter-procedural analysis.
Each function is summarized by a label indicating its ref
dependencies, and a label propagation algorithm is used to label each
function.
The only tricky case is the (arguably rare) case of mutually recursive
ref return functions (corresponding to loops in the graph), for which
we can fall back to the runtime check, but for which I also believe we
can have a simple compile time solution with a bit more care.

I have updated the algorithmic details in the DIP.


More information about the Digitalmars-d mailing list