Yet another strike against the current AA implementation

Walter Bright newshound1 at digitalmars.com
Wed Apr 29 15:01:35 PDT 2009


Andrei Alexandrescu wrote:
> Computing the stack depth even for non-recursive functions is an 
> interprocedural analysis so it's difficult to do modularly. The stack is 
> also unchecked so going with a "good enough" approximation is bound to 
> be risky.

No way in hell is there a reliable way for a compiler to estimate stack 
depth. Heck, just a virtual function call blows it.

The stack, however, is checked. The virtual memory system puts a "guard" 
page following the end of the stack, so running off the end produces an 
exception. If there is unallocated space beyond that, the operating 
system will allocate more pages, then resume from the exception.



More information about the Digitalmars-d mailing list