RuntimeHelpers.ProbeForSufficientStack メソッド

定義

注意事項

The Constrained Execution Region (CER) feature is not supported.

一定量のスタック領域をプローブして、後続のコード ブロック内でスタック オーバーフローが発生しないことを確認します (コードは有限かつ適度な量のスタック領域だけを使用することを前提に)。 このメソッドではなく、制約された実行領域 (CER) を使用することをお勧めします。

public:
 static void ProbeForSufficientStack();
[System.Obsolete("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId="SYSLIB0004", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static void ProbeForSufficientStack ();
[System.Security.SecurityCritical]
public static void ProbeForSufficientStack ();
public static void ProbeForSufficientStack ();
[<System.Obsolete("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId="SYSLIB0004", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member ProbeForSufficientStack : unit -> unit
[<System.Security.SecurityCritical>]
static member ProbeForSufficientStack : unit -> unit
static member ProbeForSufficientStack : unit -> unit
Public Shared Sub ProbeForSufficientStack ()
属性

注釈

このメソッドは、Microsoft SQL Server や Microsoft Exchange Server などのスタック オーバーフローに対する回復性があるホストで実行する場合に、制約付き実行領域 (CER) インフラストラクチャによって使用されます。 このメソッドは現在、x86 プラットフォームで 48 KB のスタック領域をプローブしていますが、正確な量は時間の経過と同時に変化する可能性があり、他のプラットフォームによって異なる場合があります。

このメソッドはコンパイラでも使用されます。

メソッドを使用する ProbeForSufficientStack 代わりに、標準の CER を使用する必要があります。 つまり、適度な量のスタック領域を使用する予定の場合は、 またはcatch/try ブロックの直前に RuntimeHelpers.PrepareConstrainedRegions メソッドをtry/finally呼び出します。 再帰メソッドを呼び出す場合、または多くのスタック領域を使用する予定の場合は、 メソッドを使用する RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup 必要があります。

適用対象