Escape analysis

Robert Jacques sandford at jhu.edu
Mon Oct 27 21:34:28 PDT 2008


On Mon, 27 Oct 2008 23:05:48 -0400, Walter Bright  
<newshound1 at digitalmars.com> wrote:
> scope is a storage class, not a type constructor.

Okay, I'm confused. I had assumed that the escape scope was different from  
the storage scope as the storage scope has a few known problems with  
regard to escape analysis as currently defined
e.g.
class Node { Node next };

void append(scope Node a) {
     scope b = new Node();
     a.next = b; // b just escaped
}

scope const also has similar issues. So is the plan for the compilier  
going to do a static escape analysis based on the funtion signiture?

Alternatively, a deep type which prevents assignment except at declaration  
grantees (I think) no escape.



More information about the Digitalmars-d mailing list