Escape analysis

Robert Jacques sandford at jhu.edu
Tue Oct 28 11:09:30 PDT 2008


On Tue, 28 Oct 2008 09:44:28 -0400, Steven Schveighoffer  
<schveiguy at yahoo.com> wrote:
> shared/unshared is not a storage class, it is a type modifier (like  
> const).

No, because shared and local objects get created and garbage collected on  
different heaps.

> In order for escape analysis to be useful, I need to be able to specify  
> in a
> function such as:
>
> void foo(int *x, int **y, int **z)
>
> That x might escape to y's or z's scope.  How do you do allow that
> specification without making function signatures dreadfully complicated?

Well, x escapes to y or z is easy since it's how D works today. And if you  
have a no_assignment type, then the x won't escape to y or z is easy too.  
It's the mixed cases that things get complicated in. I'd recommend looking  
up pedigree types as one possible solution.



More information about the Digitalmars-d mailing list