5 overrides of Rent
Microsoft.AspNetCore.Components.Tests (1)
Rendering\TestArrayPool.cs (1)
10public override T[] Rent(int minimumLength)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (2)
Buffers\PagedBufferedTextWriterTest.cs (2)
327public override char[] Rent(int minimumLength) 342public override char[] Rent(int minimumLength)
System.Private.CoreLib (2)
src\libraries\System.Private.CoreLib\src\System\Buffers\ConfigurableArrayPool.cs (1)
53public override T[] Rent(int minimumLength)
src\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (1)
50public override T[] Rent(int minimumLength)
825 references to Rent
Aspire.Dashboard (1)
src\Shared\CompareHelpers.cs (1)
25(requestPooled = ArrayPool<byte>.Shared.Rent(requestByteCount))).Slice(0, requestByteCount);
Aspire.Hosting (1)
src\Shared\CompareHelpers.cs (1)
25(requestPooled = ArrayPool<byte>.Shared.Rent(requestByteCount))).Slice(0, requestByteCount);
GenerateDocumentationAndConfigFiles (3)
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
illink (2)
Metrics (3)
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
Metrics.Legacy (3)
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
Microsoft.AspNetCore.Components (5)
NavigationManager.cs (1)
405var locationChangingHandlersCopy = ArrayPool<Func<LocationChangingContext, ValueTask>>.Shared.Rent(handlerCount);
Routing\RouteContext.cs (1)
61_pooled = ArrayPool<byte>.Shared.Rent(length);
src\Components\Shared\src\ArrayBuilder.cs (1)
182var newItems = _arrayPool.Rent(newCapacity);
SupplyParameterFromPersistentComponentStateValueProvider.cs (2)
214var newPool = pool == null ? ArrayPool<byte>.Shared.Rent(size ?? 2048) : ArrayPool<byte>.Shared.Rent(pool.Length * 2);
Microsoft.AspNetCore.Components.Endpoints (5)
Builder\ResourceCollectionUrlEndpoint.cs (1)
146rented = ArrayPool<byte>.Shared.Rent(length);
FormMapping\Converters\CollectionAdapters\ArrayPoolBufferAdapter.cs (2)
12public static PooledBuffer CreateBuffer() => new() { Data = ArrayPool<TElement>.Shared.Rent(16), Count = 0 }; 18var newBuffer = ArrayPool<TElement>.Shared.Rent(buffer.Data.Length * 2);
FormMapping\HttpContextFormValueMapper.cs (1)
130buffer = ArrayPool<char>.Shared.Rent(options.MaxKeyBufferSize);
FormMapping\PrefixResolver.cs (1)
17_sortedKeys = ArrayPool<FormKey>.Shared.Rent(count);
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
Binding\FormDataMapperTests.cs (1)
2371var result = ArrayPool<int>.Shared.Rent(size);
Microsoft.AspNetCore.Components.Forms (3)
src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (3)
24var array = s_arrayPool.Rent(conservativeEstimatedStringLength); 60var newBuffer = s_arrayPool.Rent(sizeToRent); 81var newBuffer = s_arrayPool.Rent(sizeToRent);
Microsoft.AspNetCore.Components.Server (10)
BlazorPack\SequenceOfT.cs (1)
235segment.Assign(this.arrayPool.Rent(minBufferSize.Value == -1 ? DefaultLengthFromArrayPool : minBufferSize.Value));
Circuits\ServerComponentDeserializer.cs (1)
309: (seenComponentIdsStorage = ArrayPool<int>.Shared.Rent(operations.Length)).AsSpan(0, operations.Length);
ComponentHub.cs (1)
495var buffer = ArrayPool<byte>.Shared.Rent(32 * 1024);
src\Components\Shared\src\ArrayBuilder.cs (1)
182var newItems = _arrayPool.Rent(newCapacity);
src\Shared\PooledArrayBufferWriter.cs (3)
19_rentedBuffer = ArrayPool<T>.Shared.Rent(MinimumBufferSize); 27_rentedBuffer = ArrayPool<T>.Shared.Rent(initialCapacity); 163_rentedBuffer = ArrayPool<T>.Shared.Rent(newSize);
src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
187_currentSegment = ArrayPool<byte>.Shared.Rent(Math.Max(_minimumSegmentSize, sizeHint));
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackReader.cs (1)
1102char[] charArray = ArrayPool<char>.Shared.Rent(maxCharLength);
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackWriter.cs (1)
1302var buffer = ArrayPool<byte>.Shared.Rent((int)sourceBytesToCopy);
Microsoft.AspNetCore.Components.Web (3)
src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (3)
24var array = s_arrayPool.Rent(conservativeEstimatedStringLength); 60var newBuffer = s_arrayPool.Rent(sizeToRent); 81var newBuffer = s_arrayPool.Rent(sizeToRent);
Microsoft.AspNetCore.Components.WebAssembly (1)
src\Components\Shared\src\TransmitDataStreamToJS.cs (1)
17var buffer = ArrayPool<byte>.Shared.Rent(32 * 1024);
Microsoft.AspNetCore.Components.WebView (2)
src\Components\Shared\src\ArrayBuilder.cs (1)
182var newItems = _arrayPool.Rent(newCapacity);
src\Components\Shared\src\TransmitDataStreamToJS.cs (1)
17var buffer = ArrayPool<byte>.Shared.Rent(32 * 1024);
Microsoft.AspNetCore.DataProtection (1)
KeyManagement\KeyRingBasedDataProtector.cs (1)
372Span<int> purposeLengthsPool = targetLength <= 32 ? stackalloc int[targetLength] : (lease = ArrayPool<int>.Shared.Rent(targetLength)).AsSpan(0, targetLength);
Microsoft.AspNetCore.Diagnostics.Middleware (1)
Logging\HttpLoggingRedactionInterceptor.cs (1)
108var routeParams = ArrayPool<HttpRouteParameter>.Shared.Rent(routeSegments.ParameterCount);
Microsoft.AspNetCore.Http (1)
src\Http\Shared\StreamCopyOperationInternal.cs (1)
36var buffer = ArrayPool<byte>.Shared.Rent(bufferSize);
Microsoft.AspNetCore.Http.Abstractions (1)
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
91T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
Microsoft.AspNetCore.Http.Connections (1)
src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
187_currentSegment = ArrayPool<byte>.Shared.Rent(Math.Max(_minimumSegmentSize, sizeHint));
Microsoft.AspNetCore.Http.Extensions (8)
RequestDelegateFactory.cs (1)
2236buffer = ArrayPool<char>.Shared.Rent(maxKeyBufferSize);
src\Components\Endpoints\src\FormMapping\Converters\CollectionAdapters\ArrayPoolBufferAdapter.cs (2)
12public static PooledBuffer CreateBuffer() => new() { Data = ArrayPool<TElement>.Shared.Rent(16), Count = 0 }; 18var newBuffer = ArrayPool<TElement>.Shared.Rent(buffer.Data.Length * 2);
src\Components\Endpoints\src\FormMapping\PrefixResolver.cs (1)
17_sortedKeys = ArrayPool<FormKey>.Shared.Rent(count);
src\Http\Shared\StreamCopyOperationInternal.cs (1)
36var buffer = ArrayPool<byte>.Shared.Rent(bufferSize);
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
91T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (2)
27_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 293char[] poolArray = ArrayPool<char>.Shared.Rent((int)Math.Max((uint)(_pos + additionalCapacityBeyondPos), (uint)_chars.Length * 2));
Microsoft.AspNetCore.Http.Results (1)
src\Http\Shared\StreamCopyOperationInternal.cs (1)
36var buffer = ArrayPool<byte>.Shared.Rent(bufferSize);
Microsoft.AspNetCore.HttpLogging (4)
BufferingStream.cs (1)
169newSegment.SetOwnedMemory(ArrayPool<byte>.Shared.Rent(GetSegmentSize(sizeHint)));
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
91T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (2)
27_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 293char[] poolArray = ArrayPool<char>.Shared.Rent((int)Math.Max((uint)(_pos + additionalCapacityBeyondPos), (uint)_chars.Length * 2));
Microsoft.AspNetCore.Identity (2)
Passkeys\BufferSourceJsonConverter.cs (2)
49(pooledArray = ArrayPool<byte>.Shared.Rent(utf8Unescaped.Length)); 82(pooledArray = ArrayPool<byte>.Shared.Rent(encodedLength));
Microsoft.AspNetCore.Mvc.Core.Test (1)
ContentResultTest.cs (1)
263.Setup(ap => ap.Rent(DefaultCharacterChunkSize))
Microsoft.AspNetCore.Mvc.NewtonsoftJson (1)
JsonArrayPool.cs (1)
22return _inner.Rent(minimumLength);
Microsoft.AspNetCore.Mvc.ViewFeatures (5)
Buffers\ArrayPoolBufferSource.cs (1)
17public char[] Rent(int bufferSize) => _pool.Rent(bufferSize);
Buffers\MemoryPoolViewBufferScope.cs (1)
58segment = _viewBufferPool.Rent(Math.Max(pageSize, MinimumSize));
src\Shared\PooledArrayBufferWriter.cs (3)
19_rentedBuffer = ArrayPool<T>.Shared.Rent(MinimumBufferSize); 27_rentedBuffer = ArrayPool<T>.Shared.Rent(initialCapacity); 163_rentedBuffer = ArrayPool<T>.Shared.Rent(newSize);
Microsoft.AspNetCore.OpenApi (1)
src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
187_currentSegment = ArrayPool<byte>.Shared.Rent(Math.Max(_minimumSegmentSize, sizeHint));
Microsoft.AspNetCore.OutputCaching (4)
OutputCacheEntry.cs (1)
90var arr = ArrayPool<(string, StringValues)>.Shared.Rent(count);
OutputCacheEntryFormatter.cs (2)
80lease = ArrayPool<string>.Shared.Rent(tags.Count); 267var headerArr = ArrayPool<(string Name, StringValues Values)>.Shared.Rent(headersCount);
RecyclableArrayBufferWriter.cs (1)
119_buffer = ArrayPool<T>.Shared.Rent(newSize);
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (3)
EndToEndBenchmarks.cs (3)
52_payloadOversized = ArrayPool<byte>.Shared.Rent(PayloadLength); 207var oversized = ArrayPool<byte>.Shared.Rent(PayloadLength); 277public NullPipeWriter(int size) => _buffer = ArrayPool<byte>.Shared.Rent(size);
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (1)
RedisOutputCacheStore.cs (1)
257leased = ArrayPool<byte>.Shared.Rent(len);
Microsoft.AspNetCore.OutputCaching.Tests (1)
OutputCacheEntryFormatterTests.cs (1)
199lease = ArrayPool<byte>.Shared.Rent(len);
Microsoft.AspNetCore.Owin (1)
WebSockets\OwinWebSocketAdapter.cs (1)
138var buffer = ArrayPool<byte>.Shared.Rent(_rentedBufferSize);
Microsoft.AspNetCore.Server.Kestrel.Core (9)
Internal\Http\Http1OutputProducer.cs (1)
709return _fakeMemory = ArrayPool<byte>.Shared.Rent(minSize);
Internal\Http\HttpParser.cs (1)
428Span<byte> headerSpan = headerLength <= 256 ? stackalloc byte[256] : array = ArrayPool<byte>.Shared.Rent(headerLength);
Internal\Http2\Http2FrameWriter.cs (2)
659largeHeaderBuffer = ArrayPool<byte>.Shared.Rent(_headersEncodingLargeBufferSize); 691largeHeaderBuffer = ArrayPool<byte>.Shared.Rent(_headersEncodingLargeBufferSize);
Internal\Http2\Http2OutputProducer.cs (1)
699return _fakeMemory = ArrayPool<byte>.Shared.Rent(minSize);
Internal\Http3\Http3OutputProducer.cs (1)
266return _fakeMemory = ArrayPool<byte>.Shared.Rent(minSize);
Internal\Infrastructure\PipeWriterHelpers\ConcurrentPipeWriter.cs (1)
367newSegment.SetOwnedMemory(ArrayPool<byte>.Shared.Rent(minSize));
src\Shared\runtime\Http3\QPack\QPackDecoder.cs (2)
672buffer = Pool.Rent(requiredLength); 676byte[] newBuffer = Pool.Rent(requiredLength);
Microsoft.AspNetCore.Shared.Tests (2)
src\Shared\runtime\Http3\QPack\QPackDecoder.cs (2)
672buffer = Pool.Rent(requiredLength); 676byte[] newBuffer = Pool.Rent(requiredLength);
Microsoft.AspNetCore.SignalR.Client.Tests (1)
src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
187_currentSegment = ArrayPool<byte>.Shared.Rent(Math.Max(_minimumSegmentSize, sizeHint));
Microsoft.AspNetCore.SignalR.Common (1)
src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
187_currentSegment = ArrayPool<byte>.Shared.Rent(Math.Max(_minimumSegmentSize, sizeHint));
Microsoft.AspNetCore.SignalR.Common.Tests (1)
Internal\Protocol\MemoryBufferWriterTests.cs (1)
20var buffer = ArrayPool<byte>.Shared.Rent(1);
Microsoft.AspNetCore.SignalR.Core (1)
Internal\Utf8HashLookup.cs (1)
84(pooled = ArrayPool<char>.Shared.Rent(count));
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
187_currentSegment = ArrayPool<byte>.Shared.Rent(Math.Max(_minimumSegmentSize, sizeHint));
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (2)
src\SignalR\common\Shared\JsonUtils.cs (1)
209return _inner.Rent(minimumLength);
src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
187_currentSegment = ArrayPool<byte>.Shared.Rent(Math.Max(_minimumSegmentSize, sizeHint));
Microsoft.AspNetCore.SignalR.Specification.Tests (1)
src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
187_currentSegment = ArrayPool<byte>.Shared.Rent(Math.Max(_minimumSegmentSize, sizeHint));
Microsoft.AspNetCore.SignalR.StackExchangeRedis (1)
src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
187_currentSegment = ArrayPool<byte>.Shared.Rent(Math.Max(_minimumSegmentSize, sizeHint));
Microsoft.AspNetCore.WebSockets (3)
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
91T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (2)
27_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 293char[] poolArray = ArrayPool<char>.Shared.Rent((int)Math.Max((uint)(_pos + additionalCapacityBeyondPos), (uint)_chars.Length * 2));
Microsoft.AspNetCore.WebUtilities (17)
BufferedReadStream.cs (1)
47_buffer = bytePool.Rent(bufferSize);
FileBufferingReadStream.cs (5)
82_rentedBuffer = bytePool.Rent(memoryThreshold); 134_rentedBuffer = bytePool.Rent(memoryThreshold); 284var rentedBuffer = _bytePool.Rent(Math.Min((int)oldBuffer.Length, _maxRentedBufferSize)); 359var rentedBuffer = _bytePool.Rent(Math.Min((int)oldBuffer.Length, _maxRentedBufferSize)); 443byte[] buffer = _bytePool.Rent(bufferSize);
FormPipeReader.cs (1)
360var byteArray = ArrayPool<byte>.Shared.Rent((int)ros.Length);
FormReader.cs (2)
64_buffer = charPool.Rent(_rentedCharPoolLength); 99_buffer = charPool.Rent(_rentedCharPoolLength);
HttpRequestStreamReader.cs (2)
86_byteBuffer = _bytePool.Rent(bufferSize); 91_charBuffer = _charPool.Rent(requiredLength);
HttpResponseStreamWriter.cs (2)
82_charBuffer = charPool.Rent(bufferSize); 87_byteBuffer = bytePool.Rent(requiredLength);
MultipartReaderStream.cs (2)
226var boundary = stream._bytePool.Rent(length); 312var boundary = stream._bytePool.Rent(length);
PagedByteBuffer.cs (1)
34_currentPage = _arrayPool.Rent(PageSize);
StreamHelperExtensions.cs (1)
58var buffer = bytePool.Rent(_maxReadBufferSize);
Microsoft.AspNetCore.WebUtilities.Tests (14)
FileBufferingReadStreamTests.cs (8)
409arrayPool.Setup(p => p.Rent(It.IsAny<int>())) 410.Returns((int m) => ArrayPool<byte>.Shared.Rent(m)); 416arrayPool.Verify(v => v.Rent(It.IsAny<int>()), Times.Never()); 425arrayPool.Verify(v => v.Rent(It.IsAny<int>()), Times.Once()); 438arrayPool.Setup(p => p.Rent(It.IsAny<int>())) 439.Returns((int m) => ArrayPool<byte>.Shared.Rent(m)); 445arrayPool.Verify(v => v.Rent(It.IsAny<int>()), Times.Never()); 454arrayPool.Verify(v => v.Rent(It.IsAny<int>()), Times.Once());
PagedByteBufferTest.cs (6)
173arrayPool.Setup(p => p.Rent(PagedByteBuffer.PageSize)) 188arrayPool.Verify(p => p.Rent(It.IsAny<int>()), Times.Once()); 199arrayPool.Setup(p => p.Rent(PagedByteBuffer.PageSize)) 213arrayPool.Verify(p => p.Rent(It.IsAny<int>()), Times.Once()); 223arrayPool.Setup(p => p.Rent(PagedByteBuffer.PageSize)) 233arrayPool.Verify(p => p.Rent(It.IsAny<int>()), Times.Exactly(4));
Microsoft.Build (3)
InterningBinaryReader.cs (1)
156resultBuffer ??= ArrayPool<char>.Shared.Rent(stringLength); // Actual string length in chars may be smaller.
Logging\BinaryLogger\Postprocessing\StreamExtensions.cs (1)
31byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
Logging\OptimizedStringIndenter.cs (1)
139pooledArray = ArrayPool<StringSegment>.Shared.Rent(segmentCount);
Microsoft.Build.Tasks.Core (3)
Hash.cs (2)
75shaBuffer = System.Buffers.ArrayPool<byte>.Shared.Rent(ShaBufferSize); 76itemSpecChunkByteBuffer = System.Buffers.ArrayPool<byte>.Shared.Rent(s_encoding.GetMaxByteCount(MaxInputChunkLength));
InterningBinaryReader.cs (1)
156resultBuffer ??= ArrayPool<char>.Shared.Rent(stringLength); // Actual string length in chars may be smaller.
Microsoft.CodeAnalysis (2)
Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
Microsoft.CodeAnalysis.Analyzers (3)
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
Microsoft.CodeAnalysis.AnalyzerUtilities (3)
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
Microsoft.CodeAnalysis.BannedApiAnalyzers (3)
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
Microsoft.CodeAnalysis.CodeStyle (3)
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (3)
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
Microsoft.CodeAnalysis.PublicApiAnalyzers (3)
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
Microsoft.CodeAnalysis.ResxSourceGenerator (3)
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
Microsoft.CodeAnalysis.Workspaces (3)
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
Microsoft.Extensions.AI (3)
ChatCompletion\ChatResponse{T}.cs (1)
100var buffer = ArrayPool<byte>.Shared.Rent(utf8ByteLength);
ChatCompletion\DistributedCachingChatClient.cs (1)
147object?[] arr = ArrayPool<object?>.Shared.Rent(length);
Embeddings\DistributedCachingEmbeddingGenerator.cs (1)
118object?[] arr = ArrayPool<object?>.Shared.Rent(length);
Microsoft.Extensions.AI.Abstractions (4)
Embeddings\BinaryEmbedding.cs (2)
65tmpArray = ArrayPool<byte>.Shared.Rent(length); 98byte[] tmpArray = ArrayPool<byte>.Shared.Rent(length);
Functions\AIFunctionFactory.cs (2)
1076_buffer = ArrayPool<byte>.Shared.Rent(initialCapacity); 1155byte[] newBuffer = ArrayPool<byte>.Shared.Rent(newCapacity);
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceEmbeddingGenerator.cs (1)
136byte[] bytes = ArrayPool<byte>.Shared.Rent(Base64.GetMaxDecodedFromUtf8Length(base64.Length));
Microsoft.Extensions.AI.OpenAI (7)
src\Shared\ServerSentEvents\ArrayBuffer.cs (3)
46: usePool ? ArrayPool<byte>.Shared.Rent(initialSize) : new byte[initialSize]; 139_bytes = ArrayPool<byte>.Shared.Rent(byteCount); 164ArrayPool<byte>.Shared.Rent(newSize) :
src\Shared\ServerSentEvents\Helpers.cs (1)
98byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length);
src\Shared\ServerSentEvents\SseParser_1.cs (3)
120_lineBuffer = ArrayPool<byte>.Shared.Rent(DefaultArrayPoolRentSize); 200_lineBuffer = ArrayPool<byte>.Shared.Rent(DefaultArrayPoolRentSize); 561buffer = ArrayPool<byte>.Shared.Rent(Math.Max(minimumLength, DefaultArrayPoolRentSize));
Microsoft.Extensions.Caching.Hybrid (11)
Internal\DefaultHybridCache.L2.cs (2)
114byte[] oversized = ArrayPool<byte>.Shared.Rent(sizeof(long)); 228byte[] oversized = ArrayPool<byte>.Shared.Rent(maxLength);
Internal\DefaultHybridCache.StampedeStateT.cs (2)
556Span<byte> byteBuffer = maxBytes <= 128 ? stackalloc byte[128] : (leasedBytes = ArrayPool<byte>.Shared.Rent(maxBytes)); 557Span<char> charBuffer = maxChars <= 128 ? stackalloc char[128] : (leasedChars = ArrayPool<char>.Shared.Rent(maxChars));
Internal\HybridCachePayload.cs (2)
283string[] newBuffer = ArrayPool<string>.Shared.Rent(Math.Max(4, pendingTagsCount * 2)); 354scratch = ArrayPool<char>.Shared.Rent(maxChars);
Internal\InbuiltTypeSerializer.cs (2)
43byte[] oversized = ArrayPool<byte>.Shared.Rent(length); 57byte[] oversized = ArrayPool<byte>.Shared.Rent(length);
Internal\RecyclableArrayBufferWriter.cs (1)
193_buffer = ArrayPool<T>.Shared.Rent(newSize);
Internal\TagSet.cs (2)
137string[] oversized = ArrayPool<string>.Shared.Rent(8); 145string[] bigger = ArrayPool<string>.Shared.Rent(count * 2);
Microsoft.Extensions.Caching.Hybrid.Tests (8)
BufferReleaseTests.cs (2)
132var arr = ArrayPool<byte>.Shared.Rent(HybridCachePayload.GetMaxBytes(key, TagSet.Empty, writer.CommittedBytes)); 195var arr = ArrayPool<byte>.Shared.Rent(HybridCachePayload.GetMaxBytes(key, TagSet.Empty, writer.CommittedBytes));
PayloadTests.cs (6)
48var oversized = ArrayPool<byte>.Shared.Rent(maxLen); 78var oversized = ArrayPool<byte>.Shared.Rent(maxLen); 112var oversized = ArrayPool<byte>.Shared.Rent(maxLen); 142var oversized = ArrayPool<byte>.Shared.Rent(maxLen); 178var oversized = ArrayPool<byte>.Shared.Rent(maxLen); 232var oversized = ArrayPool<byte>.Shared.Rent(maxLen);
Microsoft.Extensions.Caching.SqlServer (2)
DatabaseOperations.cs (1)
336lease ??= ArrayPool<byte>.Shared.Rent(DefaultPageSize);
SqlServerCache.cs (1)
250lease = ArrayPool<byte>.Shared.Rent(length);
Microsoft.Extensions.Caching.StackExchangeRedis (1)
RedisCache.cs (1)
141lease = ArrayPool<byte>.Shared.Rent(length);
Microsoft.Extensions.Compliance.Abstractions (1)
src\Shared\RentedSpan\RentedSpan.cs (1)
57_rentedBuffer = ArrayPool<T>.Shared.Rent(length);
Microsoft.Extensions.DependencyModel (3)
DependencyContextJsonReader.cs (3)
67rented = ArrayPool<byte>.Shared.Rent(checked((int)expectedLength)); 71rented = ArrayPool<byte>.Shared.Rent(UnseekableStreamInitialRentSize); 103rented = ArrayPool<byte>.Shared.Rent(checked(toReturn.Length * 2));
Microsoft.Extensions.Diagnostics.ResourceMonitoring (2)
Linux\OSFileSystem.cs (1)
59Memory<byte> buffer = ArrayPool<byte>.Shared.Rent(MaxStackalloc);
src\Shared\RentedSpan\RentedSpan.cs (1)
57_rentedBuffer = ArrayPool<T>.Shared.Rent(length);
Microsoft.Extensions.Http.Diagnostics (1)
Logging\Internal\HttpRequestReader.cs (1)
177var routeParams = ArrayPool<HttpRouteParameter>.Shared.Rent(routeSegments.ParameterCount);
Microsoft.Extensions.Logging.Abstractions (2)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
28_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 294char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
Microsoft.Extensions.Logging.Console (4)
JsonConsoleFormatter.cs (1)
106var logMessageBuffer = ArrayPool<char>.Shared.Rent(Encoding.UTF8.GetMaxCharCount(messageBytes.Length));
src\libraries\Common\src\System\Net\ArrayBuffer.cs (3)
45: usePool ? ArrayPool<byte>.Shared.Rent(initialSize) : new byte[initialSize]; 138_bytes = ArrayPool<byte>.Shared.Rent(byteCount); 164ArrayPool<byte>.Shared.Rent(newSize) :
Microsoft.Extensions.Options.Contextual (1)
Internal\ContextualOptionsFactory.cs (1)
78var loadTasks = ArrayPool<ValueTask<IConfigureContextualOptions<TOptions>>>.Shared.Rent(_loaders.Length);
Microsoft.Extensions.ServiceDiscovery.Dns (5)
Resolver\DnsResolver.cs (5)
690byte[] buffer = ArrayPool<byte>.Shared.Rent(2048); 720var buffer = ArrayPool<byte>.Shared.Rent(512); 769var buffer = ArrayPool<byte>.Shared.Rent(8 * 1024); 801var largerBuffer = ArrayPool<byte>.Shared.Rent(responseLength + 2); 896byte[] buffer = ArrayPool<byte>.Shared.Rent(256);
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (4)
Resolver\LoopbackDnsServer.cs (4)
54byte[] buffer = ArrayPool<byte>.Shared.Rent(512); 86byte[] buffer = ArrayPool<byte>.Shared.Rent(8 * 1024); 165byte[] buffer = ArrayPool<byte>.Shared.Rent(512); 209byte[] buffer = ArrayPool<byte>.Shared.Rent(512);
Microsoft.Extensions.ServiceDiscovery.Dns.Tests.Fuzzing (2)
Fuzzers\EncodedDomainNameFuzzer.cs (1)
10byte[] buffer = ArrayPool<byte>.Shared.Rent(data.Length);
Fuzzers\WriteDomainNameRoundTripFuzzer.cs (1)
16byte[] buffer = ArrayPool<byte>.Shared.Rent(data.Length * 2);
Microsoft.Extensions.Telemetry (4)
Logging\JustInTimeRedactor.cs (3)
101a = ArrayPool<char>.Shared.Rent(maxLenToRedact); 131a = ArrayPool<char>.Shared.Rent(maxLenToRedact); 157var t = ArrayPool<char>.Shared.Rent(redactedLen);
src\Shared\RentedSpan\RentedSpan.cs (1)
57_rentedBuffer = ArrayPool<T>.Shared.Rent(length);
Microsoft.JSInterop (2)
Infrastructure\DotNetDispatcher.cs (1)
223var buffer = ArrayPool<byte>.Shared.Rent(count);
src\Components\Shared\src\ArrayBuilder.cs (1)
182var newItems = _arrayPool.Rent(newCapacity);
Microsoft.ML.Core (1)
Utilities\Stream.cs (1)
698byte[] rentedArray = ArrayPool<byte>.Shared.Rent(maxChunkSizeInBytes);
Microsoft.ML.ImageAnalytics (1)
ImageLoader.cs (1)
334byte[] readBuffer = bufferPool.Rent(chunksize);
Microsoft.ML.Tokenizers (80)
Model\BPETokenizer.cs (7)
836byte[] bytes = ArrayPool<byte>.Shared.Rent(BufferLength << 1); 1322tokenBuffer = ArrayPool<char>.Shared.Rent(destinationMaxSize); 1325mappingBuffer = ArrayPool<int>.Shared.Rent(destinationMaxSize); 1435tokenBuffer = ArrayPool<char>.Shared.Rent(destinationMaxSize); 1438mappingBuffer = ArrayPool<int>.Shared.Rent(destinationMaxSize); 1515tokenBuffer = ArrayPool<char>.Shared.Rent(destinationMaxSize); 1518mappingBuffer = ArrayPool<int>.Shared.Rent(destinationMaxSize);
Model\CodeGenTokenizer.cs (12)
347mutatedInputText = ArrayPool<char>.Shared.Rent(span.Length + 1); 455tokenBuffer = ArrayPool<char>.Shared.Rent(destinationMaxSize); 458mappingBuffer = ArrayPool<int>.Shared.Rent(destinationMaxSize); 604mutatedInputText = ArrayPool<char>.Shared.Rent(span.Length + 1); 823mutatedInputText = ArrayPool<char>.Shared.Rent(span.Length + 1); 960mutatedInputText = ArrayPool<char>.Shared.Rent(span.Length + 1); 1138tokenBuffer = ArrayPool<char>.Shared.Rent(destinationMaxSize); 1141mappingBuffer = ArrayPool<int>.Shared.Rent(destinationMaxSize); 1202tokenBuffer = ArrayPool<char>.Shared.Rent(destinationMaxSize); 1205mappingBuffer = ArrayPool<int>.Shared.Rent(destinationMaxSize); 1253byte[] bytes = ArrayPool<byte>.Shared.Rent(128); 1613BpeSymbol[] symbols = ArrayPool<BpeSymbol>.Shared.Rent(text.Length);
Model\EnglishRobertaTokenizer.cs (7)
283char[] buffer = ArrayPool<char>.Shared.Rent(v.Length); 363char[] token = ArrayPool<char>.Shared.Rent(text.Length); 364int[] indexMapping = ArrayPool<int>.Shared.Rent(text.Length); 675char[] token = ArrayPool<char>.Shared.Rent(text.Length); 676int[] indexMapping = ArrayPool<int>.Shared.Rent(text.Length); 720char[] token = ArrayPool<char>.Shared.Rent(text.Length); 721int[] indexMapping = ArrayPool<int>.Shared.Rent(text.Length);
Model\SentencePieceBaseModel.cs (4)
282charPoolArray ??= ArrayPool<char>.Shared.Rent(Math.Max(len, ApproximatedMaxEncodedBytesCount >> 1)); 304bytesPoolArray ??= ArrayPool<byte>.Shared.Rent(ApproximatedMaxEncodedBytesCount); 620charPoolArray ??= ArrayPool<char>.Shared.Rent(Math.Max(len, ApproximatedMaxEncodedBytesCount >> 1)); 658bytesPoolArray ??= ArrayPool<byte>.Shared.Rent(ApproximatedMaxEncodedBytesCount);
Model\SentencePieceBpeModel.cs (8)
152BpeSymbol[] symbols = ArrayPool<BpeSymbol>.Shared.Rent(text.Length); 231arrayPoolArray = ArrayPool<byte>.Shared.Rent(len); 435BpeSymbol[] symbols = ArrayPool<BpeSymbol>.Shared.Rent(text.Length); 531arrayPoolArray = ArrayPool<byte>.Shared.Rent(len); 703BpeSymbol[] symbols = ArrayPool<BpeSymbol>.Shared.Rent(text.Length); 794arrayPoolArray = ArrayPool<byte>.Shared.Rent(len); 972BpeSymbol[] symbols = ArrayPool<BpeSymbol>.Shared.Rent(text.Length); 1070arrayPoolArray = ArrayPool<byte>.Shared.Rent(len);
Model\SentencePieceUnigramModel.cs (16)
112int[] buffer = ArrayPool<int>.Shared.Rent(textToEncode.Length * 3); 115char[] normalizedString = ArrayPool<char>.Shared.Rent(textToEncode.Length + 2); 149char[] utf16NormalizedString = ArrayPool<char>.Shared.Rent(normalizedString.Length << 1); 166char[] utf16NormalizedString = ArrayPool<char>.Shared.Rent(normalizedString.Length << 1); 345BestPathNode[] bestPathEndsAt = ArrayPool<BestPathNode>.Shared.Rent(normalizationSpan.Length + 1); 584int[] buffer = ArrayPool<int>.Shared.Rent(textToEncode.Length * 3); 587char[]? normalizedString = maxTokenCount == int.MaxValue ? null : ArrayPool<char>.Shared.Rent(textToEncode.Length + 2); 785BestPathNode[] bestPathEndsAt = ArrayPool<BestPathNode>.Shared.Rent(normalizationSpan.Length + 1); 808unknownTokensTracking = ArrayPool<(int IdsIndex, int Utf8Index, int Utf8Length)>.Shared.Rent(10); 974int[] buffer = ArrayPool<int>.Shared.Rent(textToEncode.Length * 3); 977char[]? normalizedString = maxTokenCount == int.MaxValue ? null : ArrayPool<char>.Shared.Rent(textToEncode.Length + 2); 1116BestPathNode[] bestPathEndsAt = ArrayPool<BestPathNode>.Shared.Rent(normalizationSpan.Length + 1); 1122(int Id, int UtfStartOffset, int Utf8Length)[] ids = ArrayPool<(int Id, int UtfStartOffset, int Utf8Length)>.Shared.Rent(bestPathEndsAt.Length); 1241int[] buffer = ArrayPool<int>.Shared.Rent(textToEncode.Length * 3); 1244char[]? normalizedString = maxTokenCount == int.MaxValue ? null : ArrayPool<char>.Shared.Rent(textToEncode.Length + 2); 1367BestPathNode[] bestPathEndsAt = ArrayPool<BestPathNode>.Shared.Rent(normalizationSpan.Length + 1);
Model\TiktokenTokenizer.cs (9)
324byte[] arrayPoolArray = arrayPoolArray = ArrayPool<byte>.Shared.Rent(utf8Length); 326Span<int> indexMappingSpan = utf8Length + 1 <= 128 ? stackalloc int[128] : (indexMappingArray = ArrayPool<int>.Shared.Rent(utf8Length + 1)); 441byte[] arrayPoolArray = arrayPoolArray = ArrayPool<byte>.Shared.Rent(utf8Length); 443Span<int> indexMappingSpan = utf8Length + 1 <= 128 ? stackalloc int[128] : (indexMappingArray = ArrayPool<int>.Shared.Rent(utf8Length + 1)); 606byte[] arrayPoolArray = arrayPoolArray = ArrayPool<byte>.Shared.Rent(utf8Length); 608Span<int> indexMappingSpan = utf8Length + 1 <= 128 ? stackalloc int[128] : (indexMappingArray = ArrayPool<int>.Shared.Rent(utf8Length + 1)); 732byte[] arrayPoolArray = arrayPoolArray = ArrayPool<byte>.Shared.Rent(utf8Length); 734Span<int> indexMappingSpan = utf8Length + 1 <= 128 ? stackalloc int[128] : (indexMappingArray = ArrayPool<int>.Shared.Rent(utf8Length + 1)); 841byte[] tmp = ArrayPool<byte>.Shared.Rent(Math.Max(utf8Bytes.Length * 2, requiredCapacity));
Model\WordPieceTokenizer.cs (2)
324char[]? arrayPool = maxLength <= 250 ? null : ArrayPool<char>.Shared.Rent(maxLength); 464char[]? arrayPool = maxLength <= 250 ? null : ArrayPool<char>.Shared.Rent(maxLength);
Normalizer\BertNormalizer.cs (1)
42char[] buffer = ArrayPool<char>.Shared.Rent(original.Length);
Normalizer\LowerCaseNormalizer.cs (1)
45char[] arrayPoolArray = ArrayPool<char>.Shared.Rent(original.Length);
Normalizer\SentencePieceNormalizer.cs (1)
137buffer = ArrayPool<char>.Shared.Rent(spanLength);
Normalizer\UpperCaseNormalizer.cs (1)
45char[] arrayPoolArray = ArrayPool<char>.Shared.Rent(original.Length);
PreTokenizer\CompositePreTokenizer.cs (1)
149char[] buffer = ArrayPool<char>.Shared.Rent(text.Length);
Tokenizer.cs (2)
381char[] destination = ArrayPool<char>.Shared.Rent( 408destination = ArrayPool<char>.Shared.Rent((int)newSize);
Utils\BytePairEncoder.cs (1)
27(arrayPoolArray = ArrayPool<(int, int)>.Shared.Rent(requiredLength));
Utils\DoubleArrayTrie.cs (1)
754array = ArrayPool<byte>.Shared.Rent(encodingLength * 2);
Utils\Helpers.cs (2)
24T[] tmp = ArrayPool<T>.Shared.Rent(Math.Max(arrayPoolArray.Length * 2, requiredCapacity)); 34T[] newPoolArray = ArrayPool<T>.Shared.Rent(newSize);
Utils\OrdinalUtf8StringComparer.cs (2)
63bytes1 = ArrayPool<byte>.Shared.Rent(requiredLength1); 69bytes2 = ArrayPool<byte>.Shared.Rent(requiredLength2);
Utils\ValueStringBuilder.cs (2)
30_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 405char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
Microsoft.ML.Tokenizers.Tests (5)
src\Microsoft.ML.Tokenizers\Utils\DoubleArrayTrie.cs (1)
754array = ArrayPool<byte>.Shared.Rent(encodingLength * 2);
src\Microsoft.ML.Tokenizers\Utils\Helpers.cs (2)
24T[] tmp = ArrayPool<T>.Shared.Rent(Math.Max(arrayPoolArray.Length * 2, requiredCapacity)); 34T[] newPoolArray = ArrayPool<T>.Shared.Rent(newSize);
src\Microsoft.ML.Tokenizers\Utils\OrdinalUtf8StringComparer.cs (2)
63bytes1 = ArrayPool<byte>.Shared.Rent(requiredLength1); 69bytes2 = ArrayPool<byte>.Shared.Rent(requiredLength2);
Microsoft.Net.Http.Headers (2)
ContentDispositionHeaderValue.cs (2)
552: bufferFromPool = ArrayPool<byte>.Shared.Rent(requiredLength); 720unescapedBytes = ArrayPool<byte>.Shared.Rent(dataString.Length);
MSBuild (1)
InterningBinaryReader.cs (1)
156resultBuffer ??= ArrayPool<char>.Shared.Rent(stringLength); // Actual string length in chars may be smaller.
PresentationCore (2)
System\Windows\Media\RenderData.cs (2)
456_buffer = ArrayPool<byte>.Shared.Rent(cbRequiredSize); 473byte[] newBuffer = ArrayPool<byte>.Shared.Rent(newSize);
PresentationFramework (1)
System\Windows\Markup\Baml2006\Baml2006Reader.cs (1)
1114byte[] pooledArray = ArrayPool<byte>.Shared.Rent(toRead);
Roslyn.Diagnostics.Analyzers (3)
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
Shared (8)
RentedSpan\RentedSpan.cs (1)
57_rentedBuffer = ArrayPool<T>.Shared.Rent(length);
ServerSentEvents\ArrayBuffer.cs (3)
46: usePool ? ArrayPool<byte>.Shared.Rent(initialSize) : new byte[initialSize]; 139_bytes = ArrayPool<byte>.Shared.Rent(byteCount); 164ArrayPool<byte>.Shared.Rent(newSize) :
ServerSentEvents\Helpers.cs (1)
98byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length);
ServerSentEvents\SseParser_1.cs (3)
120_lineBuffer = ArrayPool<byte>.Shared.Rent(DefaultArrayPoolRentSize); 200_lineBuffer = ArrayPool<byte>.Shared.Rent(DefaultArrayPoolRentSize); 561buffer = ArrayPool<byte>.Shared.Rent(Math.Max(minimumLength, DefaultArrayPoolRentSize));
System.Collections.Immutable (10)
System\Collections\Frozen\FrozenHashTable.cs (2)
59int[] arrayPoolBuckets = ArrayPool<int>.Shared.Rent(numBuckets + hashCodes.Length); 214int[] seenBuckets = ArrayPool<int>.Shared.Rent((maxNumBuckets / BitsPerInt32) + 1);
System\Collections\Frozen\FrozenSetInternalBase.cs (1)
200(rentedArray = ArrayPool<int>.Shared.Rent(intArrayLength));
System\Collections\Frozen\Int32\Int32FrozenDictionary.cs (1)
31int[] arrayPoolHashCodes = ArrayPool<int>.Shared.Rent(entries.Length);
System\Collections\Frozen\Int32\Int32FrozenSet.cs (1)
25int[] entries = ArrayPool<int>.Shared.Rent(count);
System\Collections\Frozen\ItemsFrozenSet.cs (1)
26int[] arrayPoolHashCodes = ArrayPool<int>.Shared.Rent(entries.Length);
System\Collections\Frozen\KeysAndValuesFrozenDictionary.cs (1)
28int[] arrayPoolHashCodes = ArrayPool<int>.Shared.Rent(entries.Length);
System\Collections\Frozen\String\LengthBuckets.cs (1)
47int[] buckets = ArrayPool<int>.Shared.Rent(arraySize);
System\Collections\Frozen\String\OrdinalStringFrozenDictionary.cs (1)
43int[] arrayPoolHashCodes = ArrayPool<int>.Shared.Rent(keys.Length);
System\Collections\Frozen\String\OrdinalStringFrozenSet.cs (1)
34int[] arrayPoolHashCodes = ArrayPool<int>.Shared.Rent(entries.Length);
System.Console (3)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
28_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 294char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System\IO\CachedConsoleStream.cs (1)
29Span<char> charSpan = (uint)maxCharCount <= 512 ? stackalloc char[512] : (pooledBuffer = ArrayPool<char>.Shared.Rent(maxCharCount));
System.Diagnostics.DiagnosticSource (2)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
28_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 294char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System.Diagnostics.Process (7)
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (2)
143byte[] bytes = ArrayPool<byte>.Shared.Rent(4096); 162byte[] temp = ArrayPool<byte>.Shared.Rent(bytes.Length * 2);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (1)
74arrayBuffer = ArrayPool<byte>.Shared.Rent(spanBuffer.Length * 2);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
28_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 294char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (1)
30_arrayToReturnToPool = ArrayPool<byte>.Shared.Rent(maxSize);
System\Diagnostics\Process.Linux.cs (1)
287byte[] tmp = ArrayPool<byte>.Shared.Rent((int)newLength);
System.Formats.Asn1 (1)
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
13internal static byte[] Rent(int minimumLength) => ArrayPool<byte>.Shared.Rent(minimumLength);
System.Formats.Cbor (2)
System\Formats\Cbor\Writer\CborWriter.Map.cs (1)
161byte[] tempBuffer = s_bufferPool.Rent(totalMapPayloadEncodingLength);
System\Formats\Cbor\Writer\CborWriter.String.cs (1)
209byte[] tempBuffer = s_bufferPool.Rent(definiteLength);
System.Formats.Nrbf (1)
System\Formats\Nrbf\Utils\TypeNameHelpers.cs (1)
209char[] rented = ArrayPool<char>.Shared.Rent(length);
System.Formats.Tar (16)
src\libraries\Common\src\System\IO\Archiving.Utils.cs (1)
24buffer = ArrayPool<char>.Shared.Rent(newCapacity);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
28_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 294char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System\Formats\Tar\TarHeader.Read.cs (5)
45byte[] rented = ArrayPool<byte>.Shared.Rent(minimumLength: TarHelpers.RecordSize); 587(buffer = ArrayPool<byte>.Shared.Rent((int)size)); 609byte[] buffer = ArrayPool<byte>.Shared.Rent((int)_size); 658(buffer = ArrayPool<byte>.Shared.Rent((int)size)); 681byte[] buffer = ArrayPool<byte>.Shared.Rent((int)_size);
System\Formats\Tar\TarHeader.Write.cs (2)
854byte[] buffer = ArrayPool<byte>.Shared.Rent(paddingAfterData); 902span = buffer = ArrayPool<byte>.Shared.Rent(length);
System\Formats\Tar\TarHelpers.cs (4)
60byte[] buffer = ArrayPool<byte>.Shared.Rent(minimumLength: (int)Math.Min(MaxBufferLength, bytesToDiscard)); 82byte[] buffer = ArrayPool<byte>.Shared.Rent(minimumLength: (int)Math.Min(MaxBufferLength, bytesToDiscard)); 96byte[] buffer = ArrayPool<byte>.Shared.Rent(minimumLength: (int)Math.Min(MaxBufferLength, bytesToCopy)); 112byte[] buffer = ArrayPool<byte>.Shared.Rent(minimumLength: (int)Math.Min(MaxBufferLength, bytesToCopy));
System\Formats\Tar\TarWriter.cs (2)
337byte[] rented = ArrayPool<byte>.Shared.Rent(minimumLength: TarHelpers.RecordSize); 375byte[] twoEmptyRecords = ArrayPool<byte>.Shared.Rent(TwoRecordSize);
System.IO.Compression (8)
System\IO\Compression\DeflateZLib\DeflateStream.cs (2)
144_buffer = ArrayPool<byte>.Shared.Rent(DefaultBufferSize); 928_arrayPoolBuffer = ArrayPool<byte>.Shared.Rent(bufferSize);
System\IO\Compression\ZipBlocks.Async.cs (2)
123byte[] arrayPoolBuffer = ArrayPool<byte>.Shared.Rent(extraFieldLength); 195arrayPoolBuffer = ArrayPool<byte>.Shared.Rent(dynamicHeaderSize);
System\IO\Compression\ZipBlocks.cs (2)
598byte[]? arrayPoolBuffer = extraFieldLength > StackAllocationThreshold ? ArrayPool<byte>.Shared.Rent(extraFieldLength) : null; 815arrayPoolBuffer = ArrayPool<byte>.Shared.Rent(dynamicHeaderSize);
System\IO\Compression\ZipHelper.Async.cs (1)
47byte[] buffer = ArrayPool<byte>.Shared.Rent(BackwardsSeekingBufferSize);
System\IO\Compression\ZipHelper.cs (1)
118byte[] buffer = ArrayPool<byte>.Shared.Rent(BackwardsSeekingBufferSize);
System.IO.Compression.Brotli (1)
System\IO\Compression\BrotliStream.cs (1)
59_buffer = ArrayPool<byte>.Shared.Rent(DefaultInternalBufferSize);
System.IO.Compression.ZipFile (1)
src\libraries\Common\src\System\IO\Archiving.Utils.cs (1)
24buffer = ArrayPool<char>.Shared.Rent(newCapacity);
System.IO.FileSystem.Watcher (2)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
28_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 294char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System.IO.Packaging (1)
System\IO\Packaging\InterleavedZipPackagePartStream.cs (1)
547byte[] readBuffer = ArrayPool<byte>.Shared.Rent(BufferSize);
System.IO.Pipelines (3)
System\IO\Pipelines\Pipe.cs (1)
253segment.SetOwnedMemory(ArrayPool<byte>.Shared.Rent(sizeToRequest));
System\IO\Pipelines\StreamPipeReader.cs (1)
528nextSegment.SetOwnedMemory(ArrayPool<byte>.Shared.Rent(sizeToRequest));
System\IO\Pipelines\StreamPipeWriter.cs (1)
167newSegment.SetOwnedMemory(ArrayPool<byte>.Shared.Rent(sizeToRequest));
System.Linq (1)
System\Linq\SegmentedArrayBuilder.cs (1)
355_currentSegment = _segments[_segmentsCount] = ArrayPool<T>.Shared.Rent(newSegmentLength);
System.Memory (3)
System\Buffers\ArrayMemoryPool.ArrayMemoryPoolBuffer.cs (1)
14_array = ArrayPool<T>.Shared.Rent(size);
System\Text\EncodingExtensions.cs (2)
178byte[] rentedArray = ArrayPool<byte>.Shared.Rent(byteCountThisIteration); 365char[] rentedArray = ArrayPool<char>.Shared.Rent(charCountThisIteration);
System.Net.Http (20)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (3)
45: usePool ? ArrayPool<byte>.Shared.Rent(initialSize) : new byte[initialSize]; 138_bytes = ArrayPool<byte>.Shared.Rent(byteCount); 164ArrayPool<byte>.Shared.Rent(newSize) :
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackDecoder.cs (2)
672buffer = Pool.Rent(requiredLength); 676byte[] newBuffer = Pool.Rent(requiredLength);
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (1)
231_blocks[allocatedBlockCount++] = ArrayPool<byte>.Shared.Rent(BlockSize);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
28_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 294char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System\Net\Http\Headers\HeaderDescriptor.cs (1)
262char[] rented = ArrayPool<char>.Shared.Rent(input.Length);
System\Net\Http\Headers\HeaderUtilities.cs (1)
71byte[] utf8bytes = ArrayPool<byte>.Shared.Rent(Encoding.UTF8.GetMaxByteCount(input.Length));
System\Net\Http\HttpContent.cs (3)
173byte[] buffer = ArrayPool<byte>.Shared.Rent((int)stream.Length); 984newBuffer = ArrayPool<byte>.Shared.Rent(newBufferCapacity); 1004newBuffer = ArrayPool<byte>.Shared.Rent(newBufferCapacity);
System\Net\Http\MultipartContent.cs (1)
651: (rentedBuffer = ArrayPool<byte>.Shared.Rent(maxLength));
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http1.cs (1)
438HttpConnection[] stackCopy = ArrayPool<HttpConnection>.Shared.Rent(pool._associatedHttp11ConnectionCount);
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (2)
1188byte[] buffer = ArrayPool<byte>.Shared.Rent(bufferSize); 1224byte[] buffer = ArrayPool<byte>.Shared.Rent(bufferSize);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
1975byte[] pooledBuffer = ArrayPool<byte>.Shared.Rent(desiredBufferSize);
System\Net\Http\SocketsHttpHandler\SocksHelper.cs (2)
67byte[] buffer = ArrayPool<byte>.Shared.Rent(BufferSize); 215byte[] buffer = ArrayPool<byte>.Shared.Rent(BufferSize);
System.Net.Mail (2)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
28_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 294char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System.Net.Ping (1)
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (1)
30_arrayToReturnToPool = ArrayPool<byte>.Shared.Rent(maxSize);
System.Net.Primitives (1)
src\libraries\Common\src\System\Net\NetworkInformation\InterfaceInfoPal.Unix.cs (1)
47: (rentedBuffer = ArrayPool<byte>.Shared.Rent(bufferSize)))
System.Net.Quic (8)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
34byte[] buffer = ArrayPool<byte>.Shared.Rent(1024);
src\libraries\Common\src\System\Net\ArrayBuffer.cs (3)
45: usePool ? ArrayPool<byte>.Shared.Rent(initialSize) : new byte[initialSize]; 138_bytes = ArrayPool<byte>.Shared.Rent(byteCount); 164ArrayPool<byte>.Shared.Rent(newSize) :
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (1)
231_blocks[allocatedBlockCount++] = ArrayPool<byte>.Shared.Rent(BlockSize);
System\Net\Quic\QuicConnection.SslConnectionOptions.cs (2)
102certDataRented = ArrayPool<byte>.Shared.Rent((int)certificateBuffer->Length); 109chainDataRented = ArrayPool<byte>.Shared.Rent((int)chainBuffer->Length);
System\Net\Quic\QuicStream.Stream.cs (1)
118byte[] rentedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length);
System.Net.Security (14)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
34byte[] buffer = ArrayPool<byte>.Shared.Rent(1024);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (2)
596byte[] buffer = ArrayPool<byte>.Shared.Rent(512); 655buffer = ArrayPool<byte>.Shared.Rent(buffer.Length * 2);
src\libraries\Common\src\System\Net\ArrayBuffer.cs (3)
45: usePool ? ArrayPool<byte>.Shared.Rent(initialSize) : new byte[initialSize]; 138_bytes = ArrayPool<byte>.Shared.Rent(byteCount); 164ArrayPool<byte>.Shared.Rent(newSize) :
src\libraries\Common\src\System\Net\Security\RC4.cs (1)
46state = ArrayPool<byte>.Shared.Rent(256);
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
13internal static byte[] Rent(int minimumLength) => ArrayPool<byte>.Shared.Rent(minimumLength);
src\libraries\Common\src\System\Text\UrlBase64Encoding.cs (2)
18char[] base64 = ArrayPool<char>.Shared.Rent(base64Len); 30char[] urlEncoded = ArrayPool<char>.Shared.Rent(urlEncodedLen);
System\Net\Security\SslStream.Protocol.cs (2)
1377Payload = RentBuffer ? ArrayPool<byte>.Shared.Rent(Size) : new byte[Size]; 1391Payload = RentBuffer ? ArrayPool<byte>.Shared.Rent(Size + size) : new byte[Size + size];
System\Net\Security\SslStreamCertificateContext.Linux.cs (2)
292IntPtr[] issuerHandles = ArrayPool<IntPtr>.Shared.Rent(_privateIntermediateCertificates.Length + 1); 310byte[] rentedBytes = ArrayPool<byte>.Shared.Rent(Interop.Crypto.GetOcspRequestDerSize(ocspRequest));
System.Net.ServerSentEvents (6)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (3)
45: usePool ? ArrayPool<byte>.Shared.Rent(initialSize) : new byte[initialSize]; 138_bytes = ArrayPool<byte>.Shared.Rent(byteCount); 164ArrayPool<byte>.Shared.Rent(newSize) :
System\Net\ServerSentEvents\SseParser_1.cs (3)
104_lineBuffer = ArrayPool<byte>.Shared.Rent(DefaultArrayPoolRentSize); 184_lineBuffer = ArrayPool<byte>.Shared.Rent(DefaultArrayPoolRentSize); 537buffer = ArrayPool<byte>.Shared.Rent(Math.Max(minimumLength, DefaultArrayPoolRentSize));
System.Net.WebSockets (11)
System\Net\WebSockets\Compression\WebSocketDeflater.cs (2)
49_buffer = ArrayPool<byte>.Shared.Rent(Math.Max(payload.Length, MinInitialBufferLength)); 67byte[] newBuffer = ArrayPool<byte>.Shared.Rent((int)(_buffer.Length * 1.3));
System\Net\WebSockets\Compression\WebSocketInflater.cs (3)
83_buffer = ArrayPool<byte>.Shared.Rent((int)Math.Min(userBufferLength, payloadLength)); 100_buffer = ArrayPool<byte>.Shared.Rent(FlushMarkerLength); 108byte[] newBuffer = ArrayPool<byte>.Shared.Rent(_available + FlushMarkerLength);
System\Net\WebSockets\ManagedWebSocket.cs (4)
1441byte[] closeBuffer = ArrayPool<byte>.Shared.Rent(MaxMessageHeaderLength + MaxControlPayloadLength); 1520buffer = ArrayPool<byte>.Shared.Rent(count); 1525buffer = ArrayPool<byte>.Shared.Rent(count); 1619_sendBuffer = ArrayPool<byte>.Shared.Rent(minLength);
System\Net\WebSockets\WebSocket.cs (2)
43byte[] array = ArrayPool<byte>.Shared.Rent(buffer.Length); 72byte[] array = ArrayPool<byte>.Shared.Rent(buffer.Length);
System.Numerics.Tensors (6)
System\Numerics\Tensors\netcore\TensorOperation.cs (1)
2640rentedBuffer._array = ArrayPool<T>.Shared.Rent(rank);
System\Numerics\Tensors\netcore\TensorShape.cs (5)
170stridesOrderArray = ArrayPool<int>.Shared.Rent(rank); 715lengthsArray = ArrayPool<nint>.Shared.Rent(rank); 772intermediateLengthsArray = ArrayPool<nint>.Shared.Rent(rank); 1049intermediateLengthsArray = ArrayPool<nint>.Shared.Rent(rank); 1052intermediateStridesArray = ArrayPool<nint>.Shared.Rent(rank);
System.Private.CoreLib (73)
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (2)
143byte[] bytes = ArrayPool<byte>.Shared.Rent(4096); 162byte[] temp = ArrayPool<byte>.Shared.Rent(bytes.Length * 2);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetCwd.cs (1)
30byte[] buf = ArrayPool<byte>.Shared.Rent(bufferSize);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (1)
74arrayBuffer = ArrayPool<byte>.Shared.Rent(spanBuffer.Length * 2);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
28_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 294char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (1)
30_arrayToReturnToPool = ArrayPool<byte>.Shared.Rent(maxSize);
src\libraries\System.Private.CoreLib\src\System\Buffers\ArrayPool.cs (6)
32/// array than was requested. Renting a buffer from it with <see cref="Rent"/> will result in an 72/// <see cref="Return"/> so that it may be reused in subsequent usage of <see cref="Rent"/>. 80/// Returns to the pool an array that was previously obtained via <see cref="Rent"/> on the same 84/// The buffer previously obtained from <see cref="Rent"/> to return to the pool. 88/// will clear <paramref name="array"/> of its contents so that a subsequent consumer via <see cref="Rent"/> 94/// and must not use it. The reference returned from a given call to <see cref="Rent"/> must only be
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlDecoder.cs (2)
169: (rented = ArrayPool<byte>.Shared.Rent(upperBound)); 385: (rented = ArrayPool<byte>.Shared.Rent(upperBound));
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (1)
213T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Icu.cs (2)
868: (borrowedArray = ArrayPool<byte>.Shared.Rent(sortKeyLength)); 893sortKey = (borrowedArray = ArrayPool<byte>.Shared.Rent(sortKeyLength));
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (1)
158(borrowedArr = ArrayPool<byte>.Shared.Rent(sortKeyLength));
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Utf8.cs (2)
92sourceUtf16Array = ArrayPool<char>.Shared.Rent(sourceMaxCharCount); 123prefixUtf16Array = ArrayPool<char>.Shared.Rent(prefixMaxCharCount);
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Icu.cs (2)
62: (toReturn = ArrayPool<char>.Shared.Rent(strInput.Length)); 107buffer = toReturn = ArrayPool<char>.Shared.Rent(realLen);
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Nls.cs (2)
54: (toReturn = ArrayPool<char>.Shared.Rent(strInput.Length)); 89buffer = toReturn = ArrayPool<char>.Shared.Rent(realLength);
src\libraries\System.Private.CoreLib\src\System\IO\BinaryReader.cs (1)
525byte[] buffer = ArrayPool<byte>.Shared.Rent(numBytes);
src\libraries\System.Private.CoreLib\src\System\IO\BinaryWriter.cs (5)
198rented = ArrayPool<byte>.Shared.Rent(maxByteCount); 367byte[] rented = ArrayPool<byte>.Shared.Rent(value.Length * 3); // max expansion: each char -> 3 bytes 392byte[] array = ArrayPool<byte>.Shared.Rent(buffer.Length); 430rented = ArrayPool<byte>.Shared.Rent(maxByteCount); 443rented = ArrayPool<byte>.Shared.Rent(MaxArrayPoolRentalSize);
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerator.Unix.cs (1)
45_pathBuffer = ArrayPool<char>.Shared.Rent(StandardBufferSize);
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (6)
1106buffer = ArrayPool<char>.Shared.Rent(sr.CurrentEncoding.GetMaxCharCount(DefaultBufferSize)); 1221byte[] rentedArray = ArrayPool<byte>.Shared.Rent(512); 1235byte[] tmp = ArrayPool<byte>.Shared.Rent((int)newLength); 1477byte[] tmp = ArrayPool<byte>.Shared.Rent((int)newLength); 1525Span<byte> bytes = (uint)bytesNeeded <= 1024 ? stackalloc byte[1024] : (rentedBytes = ArrayPool<byte>.Shared.Rent(bytesNeeded)); 1579byte[] bytes = ArrayPool<byte>.Shared.Rent(preambleSize + encoding.GetMaxByteCount(Math.Min(contents.Length, ChunkSize)));
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (6)
64byte[] buffer = ArrayPool<byte>.Shared.Rent(bufferSize); 102byte[] buffer = ArrayPool<byte>.Shared.Rent(bufferSize); 315byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length); 737byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length); 782byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length); 914byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length);
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (2)
960arrayPoolBuffer = ArrayPool<char>.Shared.Rent(charLen - charPos + 80); 964char[] newBuffer = ArrayPool<char>.Shared.Rent(checked(arrayPoolBufferPos + charLen - charPos));
src\libraries\System.Private.CoreLib\src\System\IO\TextReader.cs (3)
98char[] array = ArrayPool<char>.Shared.Rent(buffer.Length); 148char[] array = ArrayPool<char>.Shared.Rent(buffer.Length); 244char[] chars = ArrayPool<char>.Shared.Rent(4096);
src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.cs (2)
162char[] array = ArrayPool<char>.Shared.Rent(buffer.Length); 366char[] array = ArrayPool<char>.Shared.Rent(buffer.Length);
src\libraries\System.Private.CoreLib\src\System\Marvin.OrdinalIgnoreCase.cs (1)
86Span<char> scratch = (uint)count <= 64 ? stackalloc char[64] : (borrowedArr = ArrayPool<char>.Shared.Rent(count));
src\libraries\System.Private.CoreLib\src\System\Numerics\INumberBase.cs (5)
319utf16TextArray = ArrayPool<char>.Shared.Rent(textMaxCharCount); 453utf16TextArray = ArrayPool<char>.Shared.Rent(textMaxCharCount); 499utf16DestinationArray = ArrayPool<char>.Shared.Rent(destinationMaxCharCount); 555utf16TextArray = ArrayPool<char>.Shared.Rent(textMaxCharCount); 602utf16TextArray = ArrayPool<char>.Shared.Rent(textMaxCharCount);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\DefaultInterpolatedStringHandler.cs (3)
58_chars = _arrayToReturnToPool = ArrayPool<char>.Shared.Rent(GetDefaultLength(literalLength, formattedCount)); 71_chars = _arrayToReturnToPool = ArrayPool<char>.Shared.Rent(GetDefaultLength(literalLength, formattedCount)); 655char[] newArray = ArrayPool<char>.Shared.Rent(arraySize);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\TypeMapLazyDictionary.cs (1)
116char[] buffer = ArrayPool<char>.Shared.Rent(needed);
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMapState.cs (1)
169bool[] seen = ArrayPool<bool>.Shared.Rent(modulus);
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (1)
1065(borrowedArr = ArrayPool<char>.Shared.Rent(length + 1));
src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (8)
310byte[] rentedBytes = ArrayPool<byte>.Shared.Rent(DefaultReadByteBufferSize); 311char[] rentedChars = ArrayPool<char>.Shared.Rent(_readCharBufferMaxSize); 389byte[] rentedBytes = ArrayPool<byte>.Shared.Rent(DefaultReadByteBufferSize); 390char[] rentedChars = ArrayPool<char>.Shared.Rent(_readCharBufferMaxSize); 486char[] scratchChars = ArrayPool<char>.Shared.Rent(rentalLength); 487byte[] scratchBytes = ArrayPool<byte>.Shared.Rent(rentalLength); 562char[] scratchChars = ArrayPool<char>.Shared.Rent(rentalLength); 563byte[] scratchBytes = ArrayPool<byte>.Shared.Rent(rentalLength);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (2)
707char[] array = ArrayPool<char>.Shared.Rent(length); 754char[] array = ArrayPool<char>.Shared.Rent(length);
System.Private.CoreLib.Generators (1)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (1)
213T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
System.Private.Uri (2)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
28_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 294char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System.Private.Windows.Core (6)
System\BufferScope.cs (3)
25_array = ArrayPool<T>.Shared.Rent(minimumLength); 67_array = ArrayPool<T>.Shared.Rent(minimumLength); 89T[] newArray = ArrayPool<T>.Shared.Rent(capacity);
System\Text\ValueStringBuilder.cs (3)
29_chars = ArrayPool<char>.Shared.Rent( 43_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 336char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System.Private.Xml (2)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
28_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 294char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System.Reflection.Metadata (3)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
28_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 294char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System\Reflection\Internal\Utilities\EncodingHelper.netcoreapp.cs (1)
45byte[] buffer = ArrayPool<byte>.Shared.Rent(prefixedByteCount);
System.Runtime.Numerics (90)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
28_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 294char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (1)
213T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
System\Number.BigInteger.cs (11)
96buffer = arrayFromPool = ArrayPool<byte>.Shared.Rent(value.Length + 1 + 1); 352: base1E9FromPool = ArrayPool<uint>.Shared.Rent(base1E9Length)).Slice(0, base1E9Length); 378: resultBufferFromPool = ArrayPool<uint>.Shared.Rent(resultLength)).Slice(0, resultLength); 411: powersOf1e9BufferFromPool = ArrayPool<uint>.Shared.Rent(powersOf1e9BufferLength)).Slice(0, powersOf1e9BufferLength); 423: leadingFromPool = ArrayPool<uint>.Shared.Rent(leadingLength)).Slice(0, leadingLength); 470: bufferFromPool = ArrayPool<uint>.Shared.Rent(bufferLength)).Slice(0, bufferLength); 560bits = arrayToReturnToPool = ArrayPool<byte>.Shared.Rent(bytesWrittenOrNeeded); 641bytes = arrayToReturnToPool = ArrayPool<byte>.Shared.Rent(bytesWrittenOrNeeded); 796(bufferToReturn = ArrayPool<uint>.Shared.Rent(cuMax)); 874(numberBufferToReturn = ArrayPool<byte>.Shared.Rent(valueDigits + 1)); 1126: powersOfTenFromPool = ArrayPool<uint>.Shared.Rent(bits.Length)).Slice(0, bits.Length);
System\Numerics\BigInteger.cs (43)
779: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 809: remainderFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 815: quotientFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 932: bitsFromPool = ArrayPool<uint>.Shared.Rent(leftBits.Length)).Slice(0, leftBits.Length); 945: bitsFromPool = ArrayPool<uint>.Shared.Rent(leftBits.Length)).Slice(0, leftBits.Length); 1000: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1060: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1071: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1688: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1700: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1712: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1724: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1766: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1778: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1788: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 1800: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2377: leftBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2384: rightBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2391: resultBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2433: leftBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2440: rightBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2447: resultBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2484: leftBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2491: rightBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2498: resultBufferFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2538: xdFromPool = ArrayPool<uint>.Shared.Rent(xl)).Slice(0, xl); 2545: zdFromPool = ArrayPool<uint>.Shared.Rent(zl)).Slice(0, zl); 2599: xdFromPool = ArrayPool<uint>.Shared.Rent(xl)).Slice(0, xl); 2627: zdFromPool = ArrayPool<uint>.Shared.Rent(zl)).Slice(0, zl); 2741: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2753: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2763: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2775: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2788: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2830: quotientFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2856: quotientFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 2906: bitsFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 3308: xdFromPool = ArrayPool<uint>.Shared.Rent(xl); 3319: zdFromPool = ArrayPool<uint>.Shared.Rent(zl); 3463: xdFromPool = ArrayPool<uint>.Shared.Rent(xl); 3474: zdFromPool = ArrayPool<uint>.Shared.Rent(zl); 5324: xdFromPool = ArrayPool<uint>.Shared.Rent(xl)).Slice(0, xl); 5343: zdFromPool = ArrayPool<uint>.Shared.Rent(zl)).Slice(0, zl);
System\Numerics\BigIntegerCalculator.DivRem.cs (12)
107: leftCopyFromPool = ArrayPool<uint>.Shared.Rent(left.Length)).Slice(0, left.Length); 143: quotientFromPool = ArrayPool<uint>.Shared.Rent(quotientLength)).Slice(0, quotientLength); 180: leftCopyFromPool = ArrayPool<uint>.Shared.Rent(left.Length)).Slice(0, left.Length); 192: quotientActualFromPool = ArrayPool<uint>.Shared.Rent(quotientLength)).Slice(0, quotientLength); 386: bFromPool = ArrayPool<uint>.Shared.Rent(n)).Slice(0, n); 400: aFromPool = ArrayPool<uint>.Shared.Rent(aLength)).Slice(0, aLength); 440: rFromPool = ArrayPool<uint>.Shared.Rent(n + 1)).Slice(0, n + 1); 445: zFromPool = ArrayPool<uint>.Shared.Rent(2 * n)).Slice(0, 2 * n); 455: qFromPool = ArrayPool<uint>.Shared.Rent(n)).Slice(0, n); 568: r1FromPool = ArrayPool<uint>.Shared.Rent(left.Length)).Slice(0, left.Length); 612: r1FromPool = ArrayPool<uint>.Shared.Rent(right.Length + 1)).Slice(0, right.Length + 1); 641: dFromPool = ArrayPool<uint>.Shared.Rent(right.Length)).Slice(0, right.Length);
System\Numerics\BigIntegerCalculator.GcdInv.cs (1)
69: rightCopyFromPool = ArrayPool<uint>.Shared.Rent(right.Length)).Slice(0, right.Length);
System\Numerics\BigIntegerCalculator.PowMod.cs (14)
28: tempFromPool = ArrayPool<uint>.Shared.Rent(bits.Length)).Slice(0, bits.Length); 34: valueCopyFromPool = ArrayPool<uint>.Shared.Rent(bits.Length)).Slice(0, bits.Length); 221: valueCopyFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 240: tempFromPool = ArrayPool<uint>.Shared.Rent(bits.Length)).Slice(0, bits.Length); 270: valueCopyFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 289: tempFromPool = ArrayPool<uint>.Shared.Rent(bits.Length)).Slice(0, bits.Length); 328: rFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 335: muFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 342: q1FromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 348: q2FromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 388: rFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 395: muFromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 402: q1FromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size); 408: q2FromPool = ArrayPool<uint>.Shared.Rent(size)).Slice(0, size);
System\Numerics\BigIntegerCalculator.SquMul.cs (6)
102: foldFromPool = ArrayPool<uint>.Shared.Rent(foldLength)).Slice(0, foldLength); 109: coreFromPool = ArrayPool<uint>.Shared.Rent(coreLength)).Slice(0, coreLength); 227: carryFromPool = ArrayPool<uint>.Shared.Rent(carryLength)).Slice(0, carryLength); 286: leftFoldFromPool = ArrayPool<uint>.Shared.Rent(foldLength)).Slice(0, foldLength); 292: rightFoldFromPool = ArrayPool<uint>.Shared.Rent(foldLength)).Slice(0, foldLength); 305: coreFromPool = ArrayPool<uint>.Shared.Rent(coreLength)).Slice(0, coreLength);
System.Security.Cryptography (38)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (1)
74arrayBuffer = ArrayPool<byte>.Shared.Rent(spanBuffer.Length * 2);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
34byte[] buffer = ArrayPool<byte>.Shared.Rent(1024);
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
13internal static byte[] Rent(int minimumLength) => ArrayPool<byte>.Shared.Rent(minimumLength);
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (3)
605_certBags = ArrayPool<SafeBagAsn>.Shared.Rent(loaderLimits.MaxCertificates.GetValueOrDefault(10)); 606_keyBags = ArrayPool<SafeBagAsn>.Shared.Rent(loaderLimits.MaxKeys.GetValueOrDefault(10)); 760SafeBagAsn[] next = ArrayPool<SafeBagAsn>.Shared.Rent(checked(index + 1));
src\libraries\Common\src\System\Text\UrlBase64Encoding.cs (2)
18char[] base64 = ArrayPool<char>.Shared.Rent(base64Len); 30char[] urlEncoded = ArrayPool<char>.Shared.Rent(urlEncodedLen);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
28_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 294char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (1)
30_arrayToReturnToPool = ArrayPool<byte>.Shared.Rent(maxSize);
System\Security\Cryptography\CryptoStream.cs (7)
345byte[] tempInputBuffer = ArrayPool<byte>.Shared.Rent(numWholeBlocksInBytes); 387byte[] tempOutputBuffer = ArrayPool<byte>.Shared.Rent(numWholeReadBlocks * _outputBlockSize); 508byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length); 593byte[]? tempOutputBuffer = ArrayPool<byte>.Shared.Rent(checked(numWholeBlocks * _outputBlockSize)); 660byte[]? rentedBuffer = ArrayPool<byte>.Shared.Rent(inputBuffer.Length); 690byte[]? rentedBuffer = ArrayPool<byte>.Shared.Rent(bufferSize); 722byte[]? rentedBuffer = ArrayPool<byte>.Shared.Rent(bufferSize);
System\Security\Cryptography\DSA.cs (1)
898byte[] array = ArrayPool<byte>.Shared.Rent(data.Length);
System\Security\Cryptography\ECDsa.cs (4)
150rented = ArrayPool<byte>.Shared.Rent(maxSignatureSize); 432rented = ArrayPool<byte>.Shared.Rent(maxSignatureSize); 1009byte[] array = ArrayPool<byte>.Shared.Rent(data.Length); 1218byte[] array = ArrayPool<byte>.Shared.Rent(data.Length);
System\Security\Cryptography\HashAlgorithm.cs (3)
97byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 133byte[] rented = ArrayPool<byte>.Shared.Rent(4096); 254byte[] array = ArrayPool<byte>.Shared.Rent(source.Length);
System\Security\Cryptography\RandomNumberGenerator.cs (2)
59byte[] array = ArrayPool<byte>.Shared.Rent(data.Length); 82byte[] array = ArrayPool<byte>.Shared.Rent(data.Length);
System\Security\Cryptography\RSA.cs (2)
318byte[] array = ArrayPool<byte>.Shared.Rent(data.Length); 1449byte[] rented = ArrayPool<byte>.Shared.Rent(resultSize);
System\Security\Cryptography\SymmetricAlgorithm.cs (1)
772byte[] decryptRent = ArrayPool<byte>.Shared.Rent(ciphertext.Length);
System\Security\Cryptography\X509Certificates\CertificateRequest.Load.cs (1)
53byte[] rented = ArrayPool<byte>.Shared.Rent(fields.DecodedDataLength);
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Load.cs (1)
272byte[] rented = ArrayPool<byte>.Shared.Rent(fields.DecodedDataLength);
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (2)
1383_errors = ArrayPool<ErrorCollection>.Shared.Rent(size); 1391_errors = ArrayPool<ErrorCollection>.Shared.Rent(errorDepth + 1);
System\Security\Cryptography\X509Certificates\X509CertificateLoader.Unix.cs (3)
223_certAndKeys = ArrayPool<CertAndKey>.Shared.Rent(bagState.CertCount); 250_keys = ArrayPool<Pkcs12Key?>.Shared.Rent(bagState.KeyCount); 270ArrayPool<RentedSubjectPublicKeyInfo>.Shared.Rent(bagState.KeyCount);
System.Security.Cryptography.Cose (8)
System\Security\Cryptography\Cose\CoseMessage.cs (2)
435byte[] contentBuffer = ArrayPool<byte>.Shared.Rent(4096); 471byte[] contentBuffer = ArrayPool<byte>.Shared.Rent(4096);
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (2)
778byte[] buffer = ArrayPool<byte>.Shared.Rent(Math.Max(toBeSignedLength, signer.CoseKey.ComputeSignatureSize())); 854byte[] buffer = ArrayPool<byte>.Shared.Rent(Math.Max(toBeSignedLength, signer.CoseKey.ComputeSignatureSize()));
System\Security\Cryptography\Cose\CoseSign1Message.cs (2)
795byte[] buffer = ArrayPool<byte>.Shared.Rent(bufferLength); 948byte[] buffer = ArrayPool<byte>.Shared.Rent(bufferLength);
System\Security\Cryptography\Cose\CoseSignature.cs (2)
624byte[] buffer = ArrayPool<byte>.Shared.Rent(bufferLength); 655byte[] buffer = ArrayPool<byte>.Shared.Rent(bufferLength);
System.Security.Cryptography.Pkcs (1)
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
13internal static byte[] Rent(int minimumLength) => ArrayPool<byte>.Shared.Rent(minimumLength);
System.ServiceModel.NetFramingBase (6)
System\ServiceModel\Channels\Connection.cs (2)
203byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length); 242byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length);
System\ServiceModel\Channels\FramingChannels.cs (1)
380byte[] faultBuffer = ArrayPool<byte>.Shared.Rent(FaultStringDecoder.FaultSizeQuota);
System\ServiceModel\Channels\SessionConnectionReader.cs (1)
107_buffer = ArrayPool<byte>.Shared.Rent(_connection.ConnectionBufferSize);
System\ServiceModel\Channels\SingletonConnectionReader.cs (2)
137byte[] buffer = ArrayPool<byte>.Shared.Rent(Connection.ConnectionBufferSize); 538byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length);
System.Text.Encodings.Web (3)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
28_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 294char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System\Text\Encodings\Web\TextEncoder.cs (1)
521char[] rentedArray = ArrayPool<char>.Shared.Rent(Math.Max(value.Length, minBufferBumpEachIteration));
System.Text.Json (99)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (3)
45: usePool ? ArrayPool<byte>.Shared.Rent(initialSize) : new byte[initialSize]; 138_bytes = ArrayPool<byte>.Shared.Rent(byteCount); 164ArrayPool<byte>.Shared.Rent(newSize) :
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
28_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 294char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (2)
40: (rentedBuffer = ArrayPool<char>.Shared.Rent(initialBufferLength)); 157char[] newBuffer = ArrayPool<char>.Shared.Rent(newSize);
System\Text\Json\Document\JsonDocument.cs (2)
314(otherUtf8TextArray = ArrayPool<byte>.Shared.Rent(length)); 849byte[] rent = ArrayPool<byte>.Shared.Rent(length);
System\Text\Json\Document\JsonDocument.MetadataDb.cs (3)
138byte[] data = ArrayPool<byte>.Shared.Rent(initialSize); 197byte[] newRent = ArrayPool<byte>.Shared.Rent(Length); 257_data = ArrayPool<byte>.Shared.Rent(newCapacity);
System\Text\Json\Document\JsonDocument.Parse.cs (10)
87byte[] utf8Bytes = ArrayPool<byte>.Shared.Rent(length); 286byte[] utf8Bytes = ArrayPool<byte>.Shared.Rent(expectedByteCount); 312byte[] utf8Bytes = ArrayPool<byte>.Shared.Rent(expectedByteCount); 647byte[] rented = ArrayPool<byte>.Shared.Rent(length); 813rented = ArrayPool<byte>.Shared.Rent(checked((int)expectedLength)); 817rented = ArrayPool<byte>.Shared.Rent(UnseekableStreamInitialRentSize); 848rented = ArrayPool<byte>.Shared.Rent(checked(toReturn.Length * 2)); 896rented = ArrayPool<byte>.Shared.Rent(checked((int)expectedLength)); 900rented = ArrayPool<byte>.Shared.Rent(UnseekableStreamInitialRentSize); 928rented = ArrayPool<byte>.Shared.Rent(toReturn.Length * 2);
System\Text\Json\Document\JsonDocument.StackRowStack.cs (2)
23_rentedBuffer = ArrayPool<byte>.Shared.Rent(initialSize); 66_rentedBuffer = ArrayPool<byte>.Shared.Rent(toReturn.Length * 2);
System\Text\Json\Document\JsonDocument.TryGetProperty.cs (2)
77byte[] tmpUtf8 = ArrayPool<byte>.Shared.Rent(maxBytes); 189(rented = ArrayPool<byte>.Shared.Rent(remaining));
System\Text\Json\JsonEncodedText.cs (1)
85(array = ArrayPool<byte>.Shared.Rent(expectedByteCount));
System\Text\Json\JsonHelpers.cs (1)
233(rentedBuffer = ArrayPool<char>.Shared.Rent(utf8Key.Length));
System\Text\Json\JsonHelpers.Escaping.cs (2)
42(valueArray = ArrayPool<byte>.Shared.Rent(length)); 70(valueArray = ArrayPool<byte>.Shared.Rent(length));
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (9)
20(unescapedArray = ArrayPool<byte>.Shared.Rent(utf8Source.Length)); 50(pooledName = ArrayPool<byte>.Shared.Rent(length)); 77(pooledName = ArrayPool<byte>.Shared.Rent(length)); 102(unescapedArray = ArrayPool<byte>.Shared.Rent(utf8Source.Length)); 133(unescapedArray = ArrayPool<byte>.Shared.Rent(length)); 137(escapedArray = ArrayPool<byte>.Shared.Rent(length)); 175(unescapedArray1 = ArrayPool<byte>.Shared.Rent(utf8Source1.Length)); 179(unescapedArray2 = ArrayPool<byte>.Shared.Rent(utf8Source2.Length)); 224(pooledArray = ArrayPool<byte>.Shared.Rent(utf8Unescaped.Length));
System\Text\Json\Reader\Utf8JsonReader.cs (1)
544otherUtf8TextArray = ArrayPool<byte>.Shared.Rent(length);
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (3)
158(rentedBuffer = ArrayPool<byte>.Shared.Rent(valueLength)); 173(rentedBuffer = ArrayPool<byte>.Shared.Rent(valueLength)); 210(rentedBuffer = ArrayPool<byte>.Shared.Rent(sequenceLength));
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (4)
366ArrayPool<FoundProperty>.Shared.Rent(Math.Max(1, state.Current.JsonTypeInfo.PropertyCache.Length)); 373var newCache = ArrayPool<FoundProperty>.Shared.Rent(argumentState.FoundProperties.Length * 2); 562argumentState.FoundPropertiesAsync = ArrayPool<FoundPropertyAsync>.Shared.Rent(Math.Max(1, state.Current.JsonTypeInfo.PropertyCache.Length)); 568var newCache = ArrayPool<FoundPropertyAsync>.Shared.Rent(argumentState.FoundPropertiesAsync!.Length * 2);
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.Large.cs (1)
56object?[] arguments = ArrayPool<object>.Shared.Rent(typeInfo.ParameterCache.Length);
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
246: (rentedBuffer = ArrayPool<char>.Shared.Rent(bufferLength));
System\Text\Json\Serialization\Converters\Value\HalfConverter.cs (1)
46: (rentedByteBuffer = ArrayPool<byte>.Shared.Rent(bufferLength));
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (1)
43: (rentedBuffer = ArrayPool<byte>.Shared.Rent(bufferLength));
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (1)
43: (rentedBuffer = ArrayPool<byte>.Shared.Rent(bufferLength));
System\Text\Json\Serialization\JsonSerializer.Read.String.cs (2)
391json.Length <= (JsonConstants.ArrayPoolMaxSizeBeforeUsingNormalAlloc / JsonConstants.MaxExpansionFactorWhileTranscoding) ? tempArray = ArrayPool<byte>.Shared.Rent(json.Length * JsonConstants.MaxExpansionFactorWhileTranscoding) : 422json.Length <= (JsonConstants.ArrayPoolMaxSizeBeforeUsingNormalAlloc / JsonConstants.MaxExpansionFactorWhileTranscoding) ? tempArray = ArrayPool<byte>.Shared.Rent(json.Length * JsonConstants.MaxExpansionFactorWhileTranscoding) :
System\Text\Json\Serialization\ReadBufferState.cs (2)
46_buffer = ArrayPool<byte>.Shared.Rent(Math.Max(initialBufferSize, JsonConstants.Utf8Bom.Length)); 136byte[] newBuffer = ArrayPool<byte>.Shared.Rent((_buffer.Length < (int.MaxValue / 2)) ? _buffer.Length * 2 : int.MaxValue);
System\Text\Json\Writer\Utf8JsonWriter.cs (2)
823(propertyArray = ArrayPool<byte>.Shared.Rent(length)); 972(propertyArray = ArrayPool<char>.Shared.Rent(length));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Bytes.cs (2)
145(propertyArray = ArrayPool<char>.Shared.Rent(length)); 168(propertyArray = ArrayPool<byte>.Shared.Rent(length));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTime.cs (2)
152(propertyArray = ArrayPool<char>.Shared.Rent(length)); 175(propertyArray = ArrayPool<byte>.Shared.Rent(length));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTimeOffset.cs (2)
151(propertyArray = ArrayPool<char>.Shared.Rent(length)); 174(propertyArray = ArrayPool<byte>.Shared.Rent(length));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Decimal.cs (2)
151(propertyArray = ArrayPool<char>.Shared.Rent(length)); 174(propertyArray = ArrayPool<byte>.Shared.Rent(length));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Double.cs (2)
155(propertyArray = ArrayPool<char>.Shared.Rent(length)); 178(propertyArray = ArrayPool<byte>.Shared.Rent(length));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Float.cs (2)
155(propertyArray = ArrayPool<char>.Shared.Rent(length)); 178(propertyArray = ArrayPool<byte>.Shared.Rent(length));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.FormattedNumber.cs (2)
125(propertyArray = ArrayPool<char>.Shared.Rent(length)); 148(propertyArray = ArrayPool<byte>.Shared.Rent(length));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Guid.cs (2)
151(propertyArray = ArrayPool<char>.Shared.Rent(length)); 174(propertyArray = ArrayPool<byte>.Shared.Rent(length));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Literal.cs (2)
270(propertyArray = ArrayPool<char>.Shared.Rent(length)); 293(propertyArray = ArrayPool<byte>.Shared.Rent(length));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.SignedNumber.cs (2)
224(propertyArray = ArrayPool<char>.Shared.Rent(length)); 247(propertyArray = ArrayPool<byte>.Shared.Rent(length));
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (14)
123propertyArray = ArrayPool<char>.Shared.Rent(length); 282propertyArray = ArrayPool<byte>.Shared.Rent(length); 905(valueArray = ArrayPool<byte>.Shared.Rent(length)); 928(valueArray = ArrayPool<char>.Shared.Rent(length)); 951(propertyArray = ArrayPool<char>.Shared.Rent(length)); 974(propertyArray = ArrayPool<byte>.Shared.Rent(length)); 1077valueArray = ArrayPool<char>.Shared.Rent(length); 1097propertyArray = ArrayPool<char>.Shared.Rent(length); 1137valueArray = ArrayPool<byte>.Shared.Rent(length); 1157propertyArray = ArrayPool<byte>.Shared.Rent(length); 1197valueArray = ArrayPool<byte>.Shared.Rent(length); 1217propertyArray = ArrayPool<char>.Shared.Rent(length); 1257valueArray = ArrayPool<char>.Shared.Rent(length); 1277propertyArray = ArrayPool<byte>.Shared.Rent(length);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.UnsignedNumber.cs (2)
233(propertyArray = ArrayPool<char>.Shared.Rent(length)); 256(propertyArray = ArrayPool<byte>.Shared.Rent(length));
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (1)
207json.Length <= (JsonConstants.ArrayPoolMaxSizeBeforeUsingNormalAlloc / JsonConstants.MaxExpansionFactorWhileTranscoding) ? tempArray = ArrayPool<byte>.Shared.Rent(json.Length * JsonConstants.MaxExpansionFactorWhileTranscoding) :
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.String.cs (2)
194(valueArray = ArrayPool<char>.Shared.Rent(length)); 341(valueArray = ArrayPool<byte>.Shared.Rent(length));
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (2)
144(valueArray = ArrayPool<char>.Shared.Rent(length)); 310(valueArray = ArrayPool<byte>.Shared.Rent(length));
System.Text.Json.SourceGeneration (3)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (1)
213T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (2)
40: (rentedBuffer = ArrayPool<char>.Shared.Rent(initialBufferLength)); 157char[] newBuffer = ArrayPool<char>.Shared.Rent(newSize);
System.Text.RegularExpressions (5)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
28_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 294char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (1)
213T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
System\Text\RegularExpressions\Symbolic\MintermClassifier.cs (1)
53object[] arrayPoolArray = ArrayPool<object>.Shared.Rent(minterms.Length);
System\Text\StructListBuilder.cs (1)
66T[] newArray = _array = ArrayPool<T>.Shared.Rent(newSize);
System.Text.RegularExpressions.Generator (3)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
28_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 294char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (1)
213T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
System.Web.HttpUtility (4)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
28_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 294char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System\Web\Util\HttpEncoder.cs (2)
569byte[] bytes = ArrayPool<byte>.Shared.Rent(Encoding.UTF8.GetMaxByteCount(toEncode.Length)); 571char[] chars = ArrayPool<char>.Shared.Rent(utf8Length * 3);
System.Windows.Forms.UI.IntegrationTests (1)
Infra\ScreenRecordService.cs (1)
155byte[] buffer = s_pool.Rent(4096);
Test.Utilities (3)
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
Text.Analyzers (3)
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
TlsFeaturesObserve (1)
Program.cs (1)
40var bytes = ArrayPool<byte>.Shared.Rent(bytesReturned);