@safe leak fix?

Jason House jason.james.house at gmail.com
Thu Nov 12 05:45:36 PST 2009


Walter Bright Wrote:

> Jason House wrote:
> > At a fundamental level, safety isn't about pointers or references to
> > stack variables, but rather preventing their escape beyond function
> > scope. Scope parameters could be very useful. Scope delegates were
> > introduced for a similar reason.
> 
> The problem is, they aren't so easy to prove correct.

I understand the general problem with escape analysis, but I've always thought of scope input as meaning @noescape. That should lead to easy proofs. If my @noescape input (or slice of an array on the stack) is passed to a function without @noescape, it's a compile error. That reduces escape analysis to local verification. 



More information about the Digitalmars-d mailing list