Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ StartNoGCRegionWorker()

static bool System.GC.StartNoGCRegionWorker ( long totalSize,
bool hasLohSize,
long lohSize,
bool disallowFullBlockingGC )
inlinestaticprivate

Definition at line 321 of file GC.cs.

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 }
338 return (StartNoGCRegionStatus)_StartNoGCRegion(totalSize, hasLohSize, lohSize, disallowFullBlockingGC) switch
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 }
StartNoGCRegionStatus
Definition GC.cs:17
static int _StartNoGCRegion(long totalSize, bool lohSizeKnown, long lohSize, bool disallowFullBlockingGC)

References System.GC._StartNoGCRegion().

Referenced by System.GC.TryStartNoGCRegion(), System.GC.TryStartNoGCRegion(), System.GC.TryStartNoGCRegion(), and System.GC.TryStartNoGCRegion().