68 references to MaxLength
Microsoft.Extensions.Logging.Console (1)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
25private static int ArrayMaxLength => Array.MaxLength;
System.Collections (7)
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
33Debug.Assert(Array.MaxLength == ArrayMaxLength);
System\Collections\Generic\PriorityQueue.cs (2)
640if ((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)
2011(newLength = HashHelpers.GetPrime(newLength)) > Array.MaxLength) 2013newLength = Array.MaxLength;
System.Collections.Immutable (2)
System\Collections\Frozen\Integer\DenseIntegralFrozenDictionary.cs (1)
71long maxAllowedLength = Math.Min((long)count * LengthToCountFactor, Array.MaxLength);
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.Nrbf (1)
System\Formats\Nrbf\ArrayInfo.cs (1)
20internal static int MaxArrayLength => Array.MaxLength; // dynamic lookup in case the value changes in a future runtime
System.Formats.Tar (1)
System\Formats\Tar\TarHeader.Read.cs (1)
611if ((uint)_size > (uint)Array.MaxLength)
System.IO.Compression (1)
System\IO\Compression\ZipArchiveEntry.cs (1)
654maxSingleBufferSize = Array.MaxLength;
System.Linq (2)
System\Linq\SegmentedArrayBuilder.cs (2)
344if (_countInFinishedSegments > Array.MaxLength) 354int 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; 16else if (((uint)minimumBufferSize) > Array.MaxLength)
System.Net.Http (2)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
25private static int ArrayMaxLength => Array.MaxLength;
System\Net\Http\HttpContent.cs (1)
928int newBufferCapacity = (int)Math.Min((uint)lastBufferCapacity * ResizeFactor, Array.MaxLength);
System.Net.Quic (1)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
25private static int ArrayMaxLength => Array.MaxLength;
System.Net.Security (1)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
25private static int ArrayMaxLength => Array.MaxLength;
System.Net.ServerSentEvents (1)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
25private static int ArrayMaxLength => Array.MaxLength;
System.Private.CoreLib (29)
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 (1)
33Debug.Assert(Array.MaxLength == ArrayMaxLength);
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)
702if (sfh.CanSeek && (fileLength = sfh.GetFileLength()) > Array.MaxLength) 1181if (sfh.CanSeek && (fileLength = sfh.GetFileLength()) > Array.MaxLength) 1228if (newLength > Array.MaxLength) 1230newLength = (uint)Math.Max(Array.MaxLength, rentedArray.Length + 1); 1470if (newLength > Array.MaxLength) 1472newLength = (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)
689if ((uint)newLength > Array.MaxLength) 691newLength = length == Array.MaxLength ? 692Array.MaxLength + 1 : // force OOM 693Array.MaxLength; 736if ((uint)newLength > Array.MaxLength) 738newLength = length == Array.MaxLength ? 739Array.MaxLength + 1 : // force OOM 740Array.MaxLength;
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (3)
552if ((uint)minSize > Array.MaxLength) 562if (newSize > Array.MaxLength) 564newSize = (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 (1)
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
33Debug.Assert(Array.MaxLength == ArrayMaxLength);
System.Runtime.Numerics (3)
System\Number.BigInteger.cs (2)
654if (tmpCharCount > Array.MaxLength) 664Debug.Assert(digits < Array.MaxLength);
System\Numerics\BigInteger.cs (1)
37internal static int MaxLength => Array.MaxLength / kcbitUint;
System.Text.Json (2)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
25private static int ArrayMaxLength => Array.MaxLength;
System\Text\Json\Document\JsonDocument.MetadataDb.cs (1)
244Debug.Assert(MaxArrayLength == Array.MaxLength);