80 references to MaxLength
Microsoft.Extensions.Logging.Console (1)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
25private static int ArrayMaxLength => Array.MaxLength;
System.Collections (7)
src\runtime\src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
33Debug.Assert(Array.MaxLength == ArrayMaxLength);
System\Collections\Generic\PriorityQueue.cs (2)
635if ((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.Immutable (4)
System\Collections\Frozen\FrozenHashTable.cs (2)
60if ((long)numBuckets + hashCodes.Length > Array.MaxLength) 189if (minNumBuckets + hashCodes.Length > Array.MaxLength)
System\Collections\Frozen\Integer\DenseIntegralFrozenDictionary.cs (1)
71long maxAllowedLength = Math.Min((long)count * LengthToCountFactor, Array.MaxLength);
System\Collections\Frozen\String\LengthBuckets.cs (1)
31if (expectedArraySize > Array.MaxLength)
System.Collections.NonGeneric (2)
System\Collections\SortedList.cs (2)
374if ((uint)newCapacity > Array.MaxLength) newCapacity = Array.MaxLength;
System.Diagnostics.Process (3)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (2)
146if ((uint)nextCapacity > (uint)Array.MaxLength) 148nextCapacity = Math.Max(capacity + 1, Array.MaxLength);
System\Diagnostics\Process.Multiplexing.cs (1)
672int newSize = (int)Math.Min((long)buffer.Length * 2, Array.MaxLength);
System.Formats.Cbor (1)
System\Formats\Cbor\Writer\CborWriter.cs (1)
289if ((uint)newCapacity > (uint)Array.MaxLength || newCapacity < requiredCapacity)
System.Formats.Nrbf (1)
System\Formats\Nrbf\ArrayInfo.cs (1)
19internal static int MaxArrayLength => Array.MaxLength;
System.IO.Compression (5)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
25private static int ArrayMaxLength => Array.MaxLength;
System\IO\Compression\ZipArchiveEntry.Async.cs (2)
363if ((ulong)_uncompressedSize > (ulong)Array.MaxLength) 611if (_uncompressedSize > Array.MaxLength)
System\IO\Compression\ZipArchiveEntry.cs (2)
675if ((ulong)_uncompressedSize > (ulong)Array.MaxLength) 942maxSingleBufferSize = 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\runtime\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\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
25private static int ArrayMaxLength => Array.MaxLength;
System\Net\Http\HttpContent.cs (1)
943int newBufferCapacity = (int)Math.Min((uint)lastBufferCapacity * ResizeFactor, Array.MaxLength);
System.Net.Mail (2)
System\Net\BufferBuilder.cs (1)
26byte[] newBuffer = new byte[Math.Max((uint)_buffer.Length + (uint)count, Math.Min((uint)Array.MaxLength, 2 * (uint)_buffer.Length))];
System\Net\Mime\WriteStateInfoBase.cs (1)
60uint newsize = Math.Max((uint)_currentBufferUsed + (uint)moreBytes + 1, Math.Min((uint)Array.MaxLength, 2 * (uint)Buffer.Length));
System.Net.Quic (1)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
25private static int ArrayMaxLength => Array.MaxLength;
System.Net.Security (1)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
25private static int ArrayMaxLength => Array.MaxLength;
System.Net.ServerSentEvents (2)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
25private static int ArrayMaxLength => Array.MaxLength;
System\Net\ServerSentEvents\SseParser_1.cs (1)
97_maxBufferSize = Math.Min(_maxBufferSize, Array.MaxLength);
System.Private.CoreLib (34)
src\runtime\src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
33Debug.Assert(Array.MaxLength == ArrayMaxLength);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\ArrayList.cs (2)
284if ((uint)newCapacity > Array.MaxLength) newCapacity = Array.MaxLength;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentDictionary.cs (2)
1978(newLength = HashHelpers.GetPrime(newLength)) > Array.MaxLength) 1980newLength = Array.MaxLength;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (2)
496if ((uint)newCapacity > Array.MaxLength) newCapacity = Array.MaxLength;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Queue.cs (2)
406if ((uint)newcapacity > Array.MaxLength) newcapacity = Array.MaxLength;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\File.cs (6)
727if (sfh.CanSeek && (fileLength = sfh.GetFileLength()) > Array.MaxLength) 1208if (sfh.CanSeek && (fileLength = sfh.GetFileLength()) > Array.MaxLength) 1259if (newLength > Array.MaxLength) 1261newLength = (uint)Math.Max(Array.MaxLength, rentedArray.Length + 1); 1524if (newLength > Array.MaxLength) 1526newLength = (uint)Math.Max(Array.MaxLength, buffer.Length + 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (6)
146if ((uint)(_capacity * 2) > Array.MaxLength) 148newCapacity = Math.Max(value, Array.MaxLength); 312throw new ArgumentOutOfRangeException(nameof(value), SR.Format(SR.ArgumentOutOfRange_StreamLength, Array.MaxLength)); 525throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.ArgumentOutOfRange_StreamLength, Array.MaxLength)); 548throw new ArgumentOutOfRangeException(nameof(value), SR.Format(SR.ArgumentOutOfRange_StreamLength, Array.MaxLength)); 554throw new ArgumentOutOfRangeException(nameof(value), SR.Format(SR.ArgumentOutOfRange_StreamLength, Array.MaxLength));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (1)
462if (((ulong)length) > (ulong)Array.MaxLength)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (8)
699if ((uint)newLength > Array.MaxLength) 701newLength = length == Array.MaxLength ? 702Array.MaxLength + 1 : // force OOM 703Array.MaxLength; 746if ((uint)newLength > Array.MaxLength) 748newLength = length == Array.MaxLength ? 749Array.MaxLength + 1 : // force OOM 750Array.MaxLength;
src\runtime\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\Array.NativeAot.cs (1)
150if (length > MaxLength)
System.Private.Xml.Linq (1)
src\runtime\src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
33Debug.Assert(Array.MaxLength == ArrayMaxLength);
System.Runtime.Numerics (4)
System\Number.BigInteger.cs (3)
724if (tmpCharCount > Array.MaxLength) 734Debug.Assert(digits < Array.MaxLength); 869Debug.Assert(BigInteger.MaxLength * digitRatio + 1 < Array.MaxLength); // won't overflow
System\Numerics\BigInteger.cs (1)
42internal static int MaxLength => Array.MaxLength / BigIntegerCalculator.BitsPerLimb;
System.Text.Json (3)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (1)
25private static int ArrayMaxLength => Array.MaxLength;
System\Text\Json\Document\JsonDocument.MetadataDb.cs (2)
243if ((uint)newCapacity > Array.MaxLength) newCapacity = Array.MaxLength;