开发者

InsufficientExecutionStackException

开发者 https://www.devze.com 2023-02-21 01:35 出处:网络
Has anyone开发者_如何学JAVA ever encountered the InsufficientExecutionStackException? MSDN doesn\'t tell much about it.

Has anyone开发者_如何学JAVA ever encountered the InsufficientExecutionStackException? MSDN doesn't tell much about it.

What is the difference between the InsufficientExecutionStackException and the StackOverflowException?


This exception is thrown by RuntimeHelpers.EnsureSufficientExecutionStack. See https://msdn.microsoft.com/library/system.runtime.compilerservices.runtimehelpers.ensuresufficientexecutionstack.aspx

In contrast to a StackOverflowException you can catch a InsufficientExecutionStackException and handle the situation gracefully.


From CLR Via C#

Just before invoking a method, you could check for ample stack space by calling the RuntimeHelper class’s EnsureSufficientExecutionStack method This method checks if the calling thread has enough stack space available to execute the average
method (which is not well defned) If there is insuffcient stack space, the method throws an InsufficientExecutionStackException which you can catch The EnsureSufficientExecutionStack method takes no arguments and returns void This method is typically used by recursive methods

0

精彩评论

暂无评论...
验证码 换一张
取 消