Escape analysis

Jason House jason.james.house at gmail.com
Tue Oct 28 06:48:18 PDT 2008


Andrei Alexandrescu Wrote:

> Jason House wrote:
> > Walter Bright Wrote:
> > 
> >> Jason House wrote:
> >>>> scope is a storage class, not a type constructor.
> >>> How do you treat members of objects passed in? If I pass in a
> >>> struct with a delegate in it, is it treated as scope too? What if
> >>> it's an array? A class?
> >> The scope applies to the bits of the object, not what they may
> >> refer to.
> > 
> > This seems rather limiting. I know this is aimed at addressing the
> > dynamic closure problem. This solution would mean that I can't
> > encapsulate delegates. Ideally, I should be able to declare my
> > encapsulating struct as scope or noscope and manage the member
> > delegate accordingly.
> 
> I think it's clear that scope is transitive as much as const or 
> immutable are. Noscope is also transitive.
> 
> Escape analysis is a tricky business. My opinion is that we either take 
> care of it properly or blissfully ignore the entire issue. That opinion 
> may disagree a bit with Walter's, who'd prefer a quick patch for 
> delegates so he returns to threading. I think if we opt for a quick 
> patch now, it'll turn to gangrene later. Among other things, it will 
> hurt the threading infrastructure it was supposed to give precedence to.
> 
> 
> Andrei

Transitive scope means that scope can't be a storage class. It's a tricky subject and threading is way more important to me. I'm fine with a quick fix, I just don't want to pretend it's more than that.



More information about the Digitalmars-d mailing list