samuel writes:> I'm developing an application where the use of stack space is crucial.

Assumming you have a language which supports stack-allocated locals, C in
this example, why not just keep track of the min/max address of a local
var upon subroutine entry? It won't work very well if you are dynamically
allocating large arrays on the stack in leaf procedures, but usually
provides a very good approximation. I used something similar to this to
help debug a multitasking package I wrote (when modifying the context
switch routine, where the stacks kept getting all messed up).