End NoGCRegion Method
Ends the no GC region latency mode.
public: static void EndNoGCRegion();
[System.Security.SecurityCritical] public static void EndNoGCRegion ();
static member EndNoGCRegion : unit -> unit
Public Shared Sub EndNoGCRegion ()
The garbage collector is not in no GC region latency mode.
The no GC region latency mode was ended previously because a garbage collection was induced.
A memory allocation exceeded the amount specified in the call to the TryStartNoGCRegion(Int64) method.
The TryStartNoGCRegion method was not called previously.
The call to the TryStartNoGCRegion method returned
The call to the TryStartNoGCRegion method threw an exception.
You can prevent an exception for any of these reasons by using code such as the following:
if (GCSettings.LatencyMode == GCLatencyMode.NoGCRegion) GC.EndNoGCRegion();
If GCSettings.LatencyMode = GCLatencyMode.NoGCRegion Then GC.EndNoGCRegion() End If