Escape Analysis on reddit

Steven Schveighoffer schveiguy at yahoo.com
Sat Nov 1 08:28:15 PDT 2008


"Robert Fraser" wrote
> Walter Bright wrote:
>> Steven Schveighoffer wrote:
>>> FWIW, I think with changes to the compiler/linker, this can be all 
>>> detected automatically without any extra syntax.  Consider that the 
>>> linker currently resolves dependencies of symbols.  It could also 
>>> resolve incomplete escape analysis graphs.  If the graphs don't match 
>>> up, it's a linker error.  This would be needed in the case of interfaces 
>>> and virtual functions.
>>
>> Pushing things off to the linker is not practical because then you cannot 
>> rely on standard, off-the-shelf linkers.
>
> Or dynamic ones.

Both good points.  Such is the requirement for a full analysis though, as 
you don't always have all the source available, and if you have cyclic 
dependencies, you have a chicken-and-egg problem.  But if this scope 
proposal just makes D nightmarish, either with convoluted syntax or correct 
code not compiling, it's still an option to think about.

As far as dynamic linkers, at least on windows, the DLL can have a routine 
that resolves the graphs when loaded.   I'm not sure about shared objects 
though...

-Steve 





More information about the Digitalmars-d mailing list