public static void EndNoGCRegion() { EndNoGCRegionStatus status = (EndNoGCRegionStatus)_EndNoGCRegion(); if (status == EndNoGCRegionStatus.NotInProgress) { throw new InvalidOperationException(SR.InvalidOperationException_NoGCRegionNotInProgress); } else if (status == EndNoGCRegionStatus.GCInduced) { throw new InvalidOperationException(SR.InvalidOperationException_NoGCRegionInduced); } else if (status == EndNoGCRegionStatus.AllocationExceeded) { throw new InvalidOperationException(SR.InvalidOperationException_NoGCRegionAllocationExceeded); } }
public static void EndNoGCRegion() { EndNoGCRegionStatus status = (EndNoGCRegionStatus)_EndNoGCRegion(); if (status == EndNoGCRegionStatus.NotInProgress) { throw new InvalidOperationException("NoGCRegion mode must be set"); } else if (status == EndNoGCRegionStatus.GCInduced) { throw new InvalidOperationException("Garbage collection was induced in NoGCRegion mode"); } else if (status == EndNoGCRegionStatus.AllocationExceeded) { throw new InvalidOperationException("Allocated memory exceeds specified memory for NoGCRegion mode"); } }
static EndNoGCRegionStatus EndNoGCRegionWorker() { #if MONO throw new NotImplementedException(); #else EndNoGCRegionStatus status = (EndNoGCRegionStatus)_EndNoGCRegion(); if (status == EndNoGCRegionStatus.NotInProgress) { throw new InvalidOperationException("NoGCRegion mode must be set"); } else if (status == EndNoGCRegionStatus.GCInduced) { throw new InvalidOperationException("Garbage collection was induced in NoGCRegion mode"); } else if (status == EndNoGCRegionStatus.AllocationExceeded) { throw new InvalidOperationException("Allocated memory exceeds specified memory for NoGCRegion mode"); } return(EndNoGCRegionStatus.Succeeded); #endif }