This method is used by the Constrained Execution Region (CER) infrastructure, when running in hosts that are resilient to stack overflow such as Microsoft SQL & Microsoft Exchange. It probes for a certain amount of stack space, for the purpose of ensuring that a stack overflow cannot happen within a following block of code (assuming that your code itself only uses a finite and moderate amount of stack space). This method currently probes for 48K of stack space on x86, but the exact amount may change over time & vary on other platforms. This method is not recommended. Instead, you should use a normal CER (ie, a try/finally or try/catch block proceeded with a call to PrepareConstrainedRegions), if you're going to use a moderate amount of stack space. If you are calling a recursive method or will use a lot of stack space, then you must use ExecuteCodeWithGuaranteedCleanup.
Namespace: System.Runtime.CompilerServices Assembly: mscorlib (in mscorlib.dll)