Escape analysis

Walter Bright newshound1 at digitalmars.com
Tue Oct 28 14:33:34 PDT 2008


Sean Kelly wrote:
> How does the compiler handle this?  It can't tell by inspecting the type 
> whether the data for S is dynamic... in fact, the same could be said of 
> a "scope" instance of a class.  I guess it would have to assume that 
> object variables without a "noscope" label must be scoped?

What you're talking about is the escaping of pointers to local 
variables. The compiler does not detect it, except in trivial cases.

This is why, in safe mode, taking the address of a local variable will 
not be allowed.



More information about the Digitalmars-d mailing list