69 references to MaxLength
Microsoft.Extensions.Logging.Console (1)
src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (1)
32Debug.Assert(MaximumBufferSize == Array.MaxLength);
System.Collections (9)
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (3)
63if ((uint)newLength > Array.MaxLength) 65newLength = Array.MaxLength <= count ? count + 1 : Array.MaxLength;
System\Collections\Generic\PriorityQueue.cs (2)
621if ((uint)newcapacity > Array.MaxLength) newcapacity = Array.MaxLength;
System\Collections\Generic\SortedList.cs (2)
513if ((uint)newCapacity > Array.MaxLength) newCapacity = Array.MaxLength;
System\Collections\Generic\Stack.cs (2)
321if ((uint)newcapacity > Array.MaxLength) newcapacity = Array.MaxLength;
System.Collections.Concurrent (2)
System\Collections\Concurrent\ConcurrentDictionary.cs (2)
1964(newLength = HashHelpers.GetPrime(newLength)) > Array.MaxLength) 1966newLength = Array.MaxLength;
System.Collections.Immutable (1)
System\Collections\Frozen\String\LengthBuckets.cs (1)
32if (arraySize > Array.MaxLength)
System.Collections.NonGeneric (2)
System\Collections\SortedList.cs (2)
374if ((uint)newCapacity > Array.MaxLength) newCapacity = Array.MaxLength;
System.Diagnostics.Process (2)
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (2)
146if ((uint)nextCapacity > (uint)Array.MaxLength) 148nextCapacity = Math.Max(capacity + 1, Array.MaxLength);
System.Formats.Cbor (1)
System\Formats\Cbor\Writer\CborWriter.cs (1)
245Debug.Assert(MaxArrayLength == Array.MaxLength);
System.Formats.Tar (1)
System\Formats\Tar\TarHeader.Read.cs (1)
609if ((uint)_size > (uint)Array.MaxLength)
System.IO.Compression (1)
System\IO\Compression\ZipArchiveEntry.cs (1)
579int MaxSingleBufferSize = Array.MaxLength;
System.Linq (2)
System\Linq\SegmentedArrayBuilder.cs (2)
322if (_countInFinishedSegments > Array.MaxLength) 332int newSegmentLength = (int)Math.Min(Math.Max(minimumRequired, currentSegmentLength * 2L), Array.MaxLength);
System.Linq.Expressions (2)
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (2)
146if ((uint)nextCapacity > (uint)Array.MaxLength) 148nextCapacity = Math.Max(capacity + 1, Array.MaxLength);
System.Memory (2)
System\Buffers\ArrayMemoryPool.cs (2)
10public sealed override int MaxBufferSize => Array.MaxLength; 17else if (((uint)minimumBufferSize) > Array.MaxLength)
System.Net.Http (2)
System\Net\Http\HttpContent.cs (2)
993int newCapacity = twiceLength > Array.MaxLength ? 994Math.Max(value, Array.MaxLength) :
System.Private.CoreLib (31)
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (2)
146if ((uint)nextCapacity > (uint)Array.MaxLength) 148nextCapacity = Math.Max(capacity + 1, Array.MaxLength);
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (3)
63if ((uint)newLength > Array.MaxLength) 65newLength = Array.MaxLength <= count ? count + 1 : Array.MaxLength;
src\libraries\System.Private.CoreLib\src\System\Collections\ArrayList.cs (2)
284if ((uint)newCapacity > Array.MaxLength) newCapacity = Array.MaxLength;
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (2)
496if ((uint)newCapacity > Array.MaxLength) newCapacity = Array.MaxLength;
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Queue.cs (2)
406if ((uint)newcapacity > Array.MaxLength) newcapacity = Array.MaxLength;
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (6)
649if (sfh.CanSeek && (fileLength = sfh.GetFileLength()) > Array.MaxLength) 986if (sfh.CanSeek && (fileLength = sfh.GetFileLength()) > Array.MaxLength) 1033if (newLength > Array.MaxLength) 1035newLength = (uint)Math.Max(Array.MaxLength, rentedArray.Length + 1); 1236if (newLength > Array.MaxLength) 1238newLength = (uint)Math.Max(Array.MaxLength, buffer.Length + 1);
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (2)
148if ((uint)(_capacity * 2) > Array.MaxLength) 150newCapacity = Math.Max(value, Array.MaxLength);
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (1)
422if (((ulong)length) > (ulong)Array.MaxLength)
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (8)
690if ((uint)newLength > Array.MaxLength) 692newLength = length == Array.MaxLength ? 693Array.MaxLength + 1 : // force OOM 694Array.MaxLength; 737if ((uint)newLength > Array.MaxLength) 739newLength = length == Array.MaxLength ? 740Array.MaxLength + 1 : // force OOM 741Array.MaxLength;
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (3)
549if ((uint)minSize > Array.MaxLength) 559if (newSize > Array.MaxLength) 561newSize = (uint)Array.MaxLength;
System.Private.Uri (2)
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (2)
146if ((uint)nextCapacity > (uint)Array.MaxLength) 148nextCapacity = Math.Max(capacity + 1, Array.MaxLength);
System.Private.Xml.Linq (3)
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (3)
63if ((uint)newLength > Array.MaxLength) 65newLength = Array.MaxLength <= count ? count + 1 : Array.MaxLength;
System.Runtime.Numerics (3)
System\Number.BigInteger.cs (2)
764if (tmpCharCount > Array.MaxLength) 774Debug.Assert(digits < Array.MaxLength);
System\Numerics\BigInteger.cs (1)
619internal static int MaxLength => Array.MaxLength / sizeof(uint);
System.Text.Json (2)
src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (1)
32Debug.Assert(MaximumBufferSize == Array.MaxLength);
System\Text\Json\Document\JsonDocument.MetadataDb.cs (1)
244Debug.Assert(MaxArrayLength == Array.MaxLength);