Is there a way in .NET to know in runtime how much stack space is available?
I would like to throw my own defined exception right before stack overflow happens.
Let's say we have some method call inside try/catch. That method leads to unbounded recursion. Now, before the stack overflow happenes the recursion should be stopped and the exception thrown. Exception would say something like: Stopped before stack overflow.