Created
November 26, 2013 10:49
-
-
Save richardkundl/7656473 to your computer and use it in GitHub Desktop.
Ensures that the remaining stack space is large enough to execute the average .NET Framework function.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
RuntimeHelpers.EnsureSufficientExecutionStack(); | |
// call recursion | |
} | |
catch (InsufficientExecutionStackException) | |
{ | |
// catch recursion stackoverflow exception | |
} | |
catch | |
{ | |
// catch the regular exception | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment