322 {
323 if (totalSize <= 0)
324 {
325 throw new ArgumentOutOfRangeException("totalSize", "totalSize can't be zero or negative");
326 }
327 if (hasLohSize)
328 {
329 if (lohSize <= 0)
330 {
331 throw new ArgumentOutOfRangeException("lohSize", "lohSize can't be zero or negative");
332 }
333 if (lohSize > totalSize)
334 {
335 throw new ArgumentOutOfRangeException("lohSize", "lohSize can't be greater than totalSize");
336 }
337 }
339 {
340 StartNoGCRegionStatus.NotEnoughMemory => false,
341 StartNoGCRegionStatus.AlreadyInProgress =>
throw new InvalidOperationException(
"The NoGCRegion mode was already in progress"),
342 StartNoGCRegionStatus.AmountTooLarge => throw new ArgumentOutOfRangeException("totalSize", "totalSize is too large. For more information about setting the maximum size, see \"Latency Modes\" in https://go.microsoft.com/fwlink/?LinkId=522706"),
343 _ => true,
344 };
345 }
static int _StartNoGCRegion(long totalSize, bool lohSizeKnown, long lohSize, bool disallowFullBlockingGC)
@ InvalidOperationException