2 overrides of Rent
System.Private.CoreLib (2)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\ConfigurableArrayPool.cs (1)
55public override T[] Rent(int minimumLength)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (1)
51public override T[] Rent(int minimumLength)
888 references to Rent
aspire (2)
Acquisition\PeerInstallProbe.cs (1)
350var buffer = ArrayPool<byte>.Shared.Rent(4096);
Documentation\Docs\LlmsTxtParser.cs (1)
930var buffer = ArrayPool<char>.Shared.Rent(title.Length);
Aspire.Dashboard (3)
src\Shared\CompareHelpers.cs (1)
25(requestPooled = ArrayPool<byte>.Shared.Rent(requestByteCount))).Slice(0, requestByteCount);
Terminal\TerminalWebSocketProxy.cs (2)
284var buffer = ArrayPool<byte>.Shared.Rent(InboundBufferSize); 335var buffer = ArrayPool<byte>.Shared.Rent(OutboundBufferSize);
Aspire.Hosting (1)
src\Shared\CompareHelpers.cs (1)
25(requestPooled = ArrayPool<byte>.Shared.Rent(requestByteCount))).Slice(0, requestByteCount);
dotnet (4)
Commands\Test\MTP\IPC\Serializers\BaseSerializer.cs (4)
15byte[] bytes = ArrayPool<byte>.Shared.Rent(stringLen); 29byte[] bytes = ArrayPool<byte>.Shared.Rent(size); 44byte[] bytes = ArrayPool<byte>.Shared.Rent(stringutf8TotalBytes); 63byte[] bytes = ArrayPool<byte>.Shared.Rent(stringutf8TotalBytes);
GenerateDocumentationAndConfigFiles (3)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
ILCompiler.Compiler (4)
Compiler\ObjectWriter\Dwarf\DwarfFde.cs (1)
48var cfiCode = ArrayPool<byte>.Shared.Rent(4096);
Compiler\ObjectWriter\Eabi\EabiUnwindConverter.cs (1)
39byte[] unwindData = ArrayPool<byte>.Shared.Rent(1024);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
ILCompiler.TypeSystem (2)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
illink (2)
ILLink.RoslynAnalyzer (2)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
Microsoft.AspNetCore.Antiforgery (5)
Internal\DefaultAntiforgeryTokenSerializer.cs (2)
39: (tokenBytesRent = ArrayPool<byte>.Shared.Rent(maxTokenDecodedSize)); 220: (tokenBytesRent = ArrayPool<byte>.Shared.Rent(totalSize));
Internal\DefaultClaimUidExtractor.cs (1)
130: (rentedBuffer = ArrayPool<byte>.Shared.Rent(totalSize));
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (2)
132_rentedBuffer = ArrayPool<T>.Shared.Rent(rentedInitialSize); 155_rentedBuffer = ArrayPool<T>.Shared.Rent(newSize);
Microsoft.AspNetCore.Components (8)
NavigationManager.cs (1)
463var locationChangingHandlersCopy = ArrayPool<Func<LocationChangingContext, ValueTask>>.Shared.Rent(handlerCount);
PersistentState\PersistentStateValueProviderKeyResolver.cs (2)
135var newPool = pool == null ? ArrayPool<byte>.Shared.Rent(size ?? 2048) : ArrayPool<byte>.Shared.Rent(pool.Length * 2);
Routing\RouteContext.cs (1)
61_pooled = ArrayPool<byte>.Shared.Rent(length);
src\aspnetcore\src\Components\Shared\src\ArrayBuilder.cs (1)
184var newItems = _arrayPool.Rent(newCapacity);
src\aspnetcore\src\Shared\PooledArrayBufferWriter.cs (3)
19_rentedBuffer = ArrayPool<T>.Shared.Rent(MinimumBufferSize); 30_rentedBuffer = ArrayPool<T>.Shared.Rent(initialCapacity); 194_rentedBuffer = ArrayPool<T>.Shared.Rent(newSize);
Microsoft.AspNetCore.Components.Endpoints (9)
Builder\ResourceCollectionUrlEndpoint.cs (1)
185rented = ArrayPool<byte>.Shared.Rent(length);
CacheView\CacheViewKeyResolver.cs (1)
281: (rented = System.Buffers.ArrayPool<byte>.Shared.Rent(byteCount));
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);
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (2)
132_rentedBuffer = ArrayPool<T>.Shared.Rent(rentedInitialSize); 155_rentedBuffer = ArrayPool<T>.Shared.Rent(newSize);
TempData\CookieTempDataProvider.cs (1)
64: (rentedDecodeBuffer = ArrayPool<byte>.Shared.Rent(maxDecodedSize));
Microsoft.AspNetCore.Components.Forms (3)
src\aspnetcore\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)
308: (seenComponentIdsStorage = ArrayPool<int>.Shared.Rent(operations.Length)).AsSpan(0, operations.Length);
ComponentHub.cs (1)
543var buffer = ArrayPool<byte>.Shared.Rent(32 * 1024);
src\aspnetcore\src\Components\Shared\src\ArrayBuilder.cs (1)
184var newItems = _arrayPool.Rent(newCapacity);
src\aspnetcore\src\Shared\PooledArrayBufferWriter.cs (3)
19_rentedBuffer = ArrayPool<T>.Shared.Rent(MinimumBufferSize); 30_rentedBuffer = ArrayPool<T>.Shared.Rent(initialCapacity); 194_rentedBuffer = ArrayPool<T>.Shared.Rent(newSize);
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
187_currentSegment = ArrayPool<byte>.Shared.Rent(Math.Max(_minimumSegmentSize, sizeHint));
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackReader.cs (1)
1146char[] charArray = ArrayPool<char>.Shared.Rent(maxCharLength);
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackWriter.cs (1)
1354var buffer = ArrayPool<byte>.Shared.Rent((int)sourceBytesToCopy);
Microsoft.AspNetCore.Components.Web (3)
src\aspnetcore\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 (2)
src\aspnetcore\src\Components\Shared\src\ArrayBuilder.cs (1)
184var newItems = _arrayPool.Rent(newCapacity);
src\aspnetcore\src\Components\Shared\src\TransmitDataStreamToJS.cs (1)
17var buffer = ArrayPool<byte>.Shared.Rent(32 * 1024);
Microsoft.AspNetCore.Components.WebView (2)
src\aspnetcore\src\Components\Shared\src\ArrayBuilder.cs (1)
184var newItems = _arrayPool.Rent(newCapacity);
src\aspnetcore\src\Components\Shared\src\TransmitDataStreamToJS.cs (1)
17var buffer = ArrayPool<byte>.Shared.Rent(32 * 1024);
Microsoft.AspNetCore.DataProtection (14)
Cng\CbcAuthenticatedEncryptor.cs (2)
200: (rentedBuffer = ArrayPool<byte>.Shared.Rent(outputSize)); 397: (rentedBuffer = ArrayPool<byte>.Shared.Rent(outputSize));
Cng\CngGcmAuthenticatedEncryptor.cs (2)
167: (rentedBuffer = ArrayPool<byte>.Shared.Rent(outputSize)); 316: (rentedBuffer = ArrayPool<byte>.Shared.Rent(outputSize));
KeyManagement\KeyRingBasedDataProtector.cs (1)
377Span<int> purposeLengthsPool = targetLength <= 32 ? stackalloc int[targetLength] : (lease = ArrayPool<int>.Shared.Rent(targetLength)).AsSpan(0, targetLength);
Managed\AesGcmAuthenticatedEncryptor.cs (2)
170: (rentedBuffer = ArrayPool<byte>.Shared.Rent(outputSize)); 202: (rentedBuffer = ArrayPool<byte>.Shared.Rent(outputSize));
Managed\ManagedAuthenticatedEncryptor.cs (2)
304: (rentedBuffer = ArrayPool<byte>.Shared.Rent(outputSize)); 487: (rentedBuffer = ArrayPool<byte>.Shared.Rent(outputSize));
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (2)
132_rentedBuffer = ArrayPool<T>.Shared.Rent(rentedInitialSize); 155_rentedBuffer = ArrayPool<T>.Shared.Rent(newSize);
src\aspnetcore\src\Shared\PooledArrayBufferWriter.cs (3)
19_rentedBuffer = ArrayPool<T>.Shared.Rent(MinimumBufferSize); 30_rentedBuffer = ArrayPool<T>.Shared.Rent(initialCapacity); 194_rentedBuffer = ArrayPool<T>.Shared.Rent(newSize);
Microsoft.AspNetCore.DataProtection.MicroBenchmarks (5)
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (2)
132_rentedBuffer = ArrayPool<T>.Shared.Rent(rentedInitialSize); 155_rentedBuffer = ArrayPool<T>.Shared.Rent(newSize);
src\aspnetcore\src\Shared\PooledArrayBufferWriter.cs (3)
19_rentedBuffer = ArrayPool<T>.Shared.Rent(MinimumBufferSize); 30_rentedBuffer = ArrayPool<T>.Shared.Rent(initialCapacity); 194_rentedBuffer = ArrayPool<T>.Shared.Rent(newSize);
Microsoft.AspNetCore.Diagnostics.Middleware (1)
Logging\HttpLoggingRedactionInterceptor.cs (1)
108var routeParams = ArrayPool<HttpRouteParameter>.Shared.Rent(routeSegments.ParameterCount);
Microsoft.AspNetCore.Http (1)
src\aspnetcore\src\Http\Shared\StreamCopyOperationInternal.cs (1)
36var buffer = ArrayPool<byte>.Shared.Rent(bufferSize);
Microsoft.AspNetCore.Http.Abstractions (1)
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
91T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
Microsoft.AspNetCore.Http.Connections (1)
src\aspnetcore\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)
2312buffer = ArrayPool<char>.Shared.Rent(maxKeyBufferSize);
src\aspnetcore\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\aspnetcore\src\Components\Endpoints\src\FormMapping\PrefixResolver.cs (1)
17_sortedKeys = ArrayPool<FormKey>.Shared.Rent(count);
src\aspnetcore\src\Http\Shared\StreamCopyOperationInternal.cs (1)
36var buffer = ArrayPool<byte>.Shared.Rent(bufferSize);
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
91T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
src\aspnetcore\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\aspnetcore\src\Http\Shared\StreamCopyOperationInternal.cs (1)
36var buffer = ArrayPool<byte>.Shared.Rent(bufferSize);
Microsoft.AspNetCore.HttpLogging (6)
BufferingStream.cs (1)
169newSegment.SetOwnedMemory(ArrayPool<byte>.Shared.Rent(GetSegmentSize(sizeHint)));
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (2)
132_rentedBuffer = ArrayPool<T>.Shared.Rent(rentedInitialSize); 155_rentedBuffer = ArrayPool<T>.Shared.Rent(newSize);
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
91T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
src\aspnetcore\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.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\aspnetcore\src\Shared\PooledArrayBufferWriter.cs (3)
19_rentedBuffer = ArrayPool<T>.Shared.Rent(MinimumBufferSize); 30_rentedBuffer = ArrayPool<T>.Shared.Rent(initialCapacity); 194_rentedBuffer = ArrayPool<T>.Shared.Rent(newSize);
Microsoft.AspNetCore.OpenApi (1)
src\aspnetcore\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.StackExchangeRedis (1)
RedisOutputCacheStore.cs (1)
257leased = ArrayPool<byte>.Shared.Rent(len);
Microsoft.AspNetCore.Owin (1)
WebSockets\OwinWebSocketAdapter.cs (1)
138var buffer = ArrayPool<byte>.Shared.Rent(_rentedBufferSize);
Microsoft.AspNetCore.Razor.Utilities.Shared (8)
PooledArrayBufferWriter`1.cs (3)
26_rentedBuffer = ArrayPool<T>.Shared.Rent(MinimumBufferSize); 34_rentedBuffer = ArrayPool<T>.Shared.Rent(initialCapacity); 180_rentedBuffer = ArrayPool<T>.Shared.Rent(newSize);
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\MemoryBuilder`1.cs (2)
30_arrayFromPool = ArrayPool<T>.Shared.Rent(initialCapacity); 161var newArray = ArrayPool<T>.Shared.Rent(nextCapacity);
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\PooledObjects\PooledArray`1.cs (1)
39_array = pool.Rent(minimumLength);
Utilities\Hashing\NonCryptographicHashAlgorithm.cs (2)
114byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 159byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
Microsoft.AspNetCore.Server.Kestrel.Core (12)
Internal\Http\Http1Connection.cs (1)
705: (rentedBuffer = ArrayPool<byte>.Shared.Rent(absolutePath.Length));
Internal\Http\Http1OutputProducer.cs (1)
709return _fakeMemory = ArrayPool<byte>.Shared.Rent(minSize);
Internal\Http\HttpParser.cs (1)
222Span<byte> headerSpan = length <= 256 ? stackalloc byte[256] : array = ArrayPool<byte>.Shared.Rent(length);
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\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (2)
132_rentedBuffer = ArrayPool<T>.Shared.Rent(rentedInitialSize); 155_rentedBuffer = ArrayPool<T>.Shared.Rent(newSize);
src\aspnetcore\src\Shared\runtime\Http3\QPack\QPackDecoder.cs (2)
678buffer = Pool.Rent(requiredLength); 682byte[] newBuffer = Pool.Rent(requiredLength);
Microsoft.AspNetCore.Server.Kestrel.Transport.DirectTls (1)
TlsEventPump.cs (1)
1289rented = ArrayPool<byte>.Shared.Rent(helloLength);
Microsoft.AspNetCore.SignalR.Common (1)
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
187_currentSegment = ArrayPool<byte>.Shared.Rent(Math.Max(_minimumSegmentSize, sizeHint));
Microsoft.AspNetCore.SignalR.Core (1)
Internal\Utf8HashLookup.cs (1)
87(pooled = ArrayPool<char>.Shared.Rent(count));
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
187_currentSegment = ArrayPool<byte>.Shared.Rent(Math.Max(_minimumSegmentSize, sizeHint));
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (2)
src\aspnetcore\src\SignalR\common\Shared\JsonUtils.cs (1)
209return _inner.Rent(minimumLength);
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
187_currentSegment = ArrayPool<byte>.Shared.Rent(Math.Max(_minimumSegmentSize, sizeHint));
Microsoft.AspNetCore.SignalR.Specification.Tests (1)
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
187_currentSegment = ArrayPool<byte>.Shared.Rent(Math.Max(_minimumSegmentSize, sizeHint));
Microsoft.AspNetCore.SignalR.StackExchangeRedis (1)
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
187_currentSegment = ArrayPool<byte>.Shared.Rent(Math.Max(_minimumSegmentSize, sizeHint));
Microsoft.AspNetCore.WebSockets (3)
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
91T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
src\aspnetcore\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); 316var boundary = stream._bytePool.Rent(length);
PagedByteBuffer.cs (1)
34_currentPage = _arrayPool.Rent(PageSize);
StreamHelperExtensions.cs (1)
58var buffer = bytePool.Rent(_maxReadBufferSize);
Microsoft.Build (4)
BackEnd\Components\Scheduler\Scheduler.cs (2)
1054SchedulableRequest[] unscheduledRequests = _requestBufferPool.Rent(_schedulingData.UnscheduledRequestsCount); 2374SchedulableRequest[] buffer = _requestBufferPool.Rent(count);
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.Framework (6)
BackEnd\InterningBinaryReader.cs (1)
144resultBuffer ??= ArrayPool<char>.Shared.Rent(stringLength); // Actual string length in chars may be smaller.
Utilities\BufferScope.cs (3)
25_array = ArrayPool<T>.Shared.Rent(minimumLength); 67_array = ArrayPool<T>.Shared.Rent(minimumLength); 98T[] newArray = ArrayPool<T>.Shared.Rent(capacity);
Utilities\ValueStringBuilder.cs (2)
56_arrayToReturnToPool = ArrayPool<byte>.Shared.Rent(initialCapacity * sizeof(char)); 420byte[] poolArray = ArrayPool<byte>.Shared.Rent(newCapacity * sizeof(char));
Microsoft.Build.Tasks.Core (2)
Hash.cs (2)
76shaBuffer = System.Buffers.ArrayPool<byte>.Shared.Rent(ShaBufferSize); 77itemSpecChunkByteBuffer = System.Buffers.ArrayPool<byte>.Shared.Rent(s_encoding.GetMaxByteCount(MaxInputChunkLength));
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\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
Microsoft.CodeAnalysis.AnalyzerUtilities (3)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
Microsoft.CodeAnalysis.CodeStyle (3)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
Microsoft.CodeAnalysis.CSharp (2)
Syntax\SyntaxTreeDiagnosticEnumerator.cs (2)
133private NodeIteration[] _stack = ArrayPool<NodeIteration>.Shared.Rent(capacity); 166var tmp = ArrayPool<NodeIteration>.Shared.Rent(_stack.Length * 2);
Microsoft.CodeAnalysis.Razor.Compiler (4)
Language\CodeGeneration\CodeWriter.cs (1)
85lastPage = ArrayPool<ReadOnlyMemory<char>>.Shared.Rent(MinimumPageSize);
Language\Intermediate\IntermediateNodeCollection.InlineList.cs (3)
79_items = ArrayPool<IntermediateNode>.Shared.Rent(4); 107_items = ArrayPool<IntermediateNode>.Shared.Rent(4); 218var newArray = ArrayPool<IntermediateNode>.Shared.Rent(newCapacity);
Microsoft.CodeAnalysis.ResxSourceGenerator (3)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
Microsoft.CodeAnalysis.Workspaces (5)
FindSymbols\TopLevelSyntaxTree\NavigateToSearchIndex.NavigateToSearchInfo.cs (1)
187? ArrayPool<char>.Shared.Rent(maxNameLength)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
Utilities\Deque.cs (1)
100var newArray = ArrayPool<T>.Shared.Rent(newCapacity);
Microsoft.DotNet.Build.Tasks.FileCatalog (1)
CatalogEntry.cs (1)
40byte[] buffer = ArrayPool<byte>.Shared.Rent(81920);
Microsoft.DotNet.Cli.Utils (3)
BufferScope.cs (3)
29_array = ArrayPool<T>.Shared.Rent(minimumLength); 71_array = ArrayPool<T>.Shared.Rent(minimumLength); 102T[] newArray = ArrayPool<T>.Shared.Rent(capacity);
Microsoft.DotNet.HotReload.Watch (9)
src\sdk\src\Dotnet.Watch\HotReloadAgent.PipeRpc\StreamExtensions.cs (8)
28var buffer = ArrayPool<byte>.Shared.Rent(minimumLength: size); 43var buffer = ArrayPool<byte>.Shared.Rent(minimumLength: size); 67var buffer = ArrayPool<byte>.Shared.Rent(minimumLength: size); 114var buffer = ArrayPool<byte>.Shared.Rent(minimumLength: size); 129var buffer = ArrayPool<byte>.Shared.Rent(minimumLength: size); 145var buffer = ArrayPool<byte>.Shared.Rent(minimumLength: size); 186var buffer = ArrayPool<byte>.Shared.Rent(minimumLength: size); 217var buffer = ArrayPool<byte>.Shared.Rent(minimumLength: size);
src\sdk\src\Dotnet.Watch\HotReloadClient\WebSocketClientTransport.cs (1)
200var buffer = ArrayPool<byte>.Shared.Rent(4096);
Microsoft.DotNet.TemplateLocator (2)
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadManifestReader.SystemTextJson.cs (2)
53buffer = ArrayPool<byte>.Shared.Rent(segmentSize); 89var newBuffer = ArrayPool<byte>.Shared.Rent(newSegmentSize);
Microsoft.Extensions.AI (3)
ChatCompletion\ChatResponse{T}.cs (1)
96var buffer = ArrayPool<byte>.Shared.Rent(utf8ByteLength);
ChatCompletion\DistributedCachingChatClient.cs (1)
142object?[] 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)
1383_buffer = ArrayPool<byte>.Shared.Rent(initialCapacity); 1462byte[] newBuffer = ArrayPool<byte>.Shared.Rent(newCapacity);
Microsoft.Extensions.Caching.Hybrid (9)
Internal\DefaultHybridCache.L2.cs (2)
112byte[] oversized = ArrayPool<byte>.Shared.Rent(sizeof(long)); 225byte[] oversized = ArrayPool<byte>.Shared.Rent(maxLength);
Internal\DefaultHybridCache.StampedeStateT.cs (2)
549Span<byte> byteBuffer = maxBytes <= 128 ? stackalloc byte[128] : (leasedBytes = ArrayPool<byte>.Shared.Rent(maxBytes)); 550Span<char> charBuffer = maxChars <= 128 ? stackalloc char[128] : (leasedChars = ArrayPool<char>.Shared.Rent(maxChars));
Internal\HybridCachePayload.cs (2)
278string[] newBuffer = ArrayPool<string>.Shared.Rent(Math.Max(4, pendingTagsCount * 2)); 347scratch = ArrayPool<char>.Shared.Rent(maxChars);
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 (9)
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 (7)
49var oversized = ArrayPool<byte>.Shared.Rent(maxLen); 79var oversized = ArrayPool<byte>.Shared.Rent(maxLen); 113var oversized = ArrayPool<byte>.Shared.Rent(maxLen); 143var oversized = ArrayPool<byte>.Shared.Rent(maxLen); 179var oversized = ArrayPool<byte>.Shared.Rent(maxLen); 233var oversized = ArrayPool<byte>.Shared.Rent(maxLen); 346var 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)
parent\parent\parent\eng\MSBuild\parent\parent\src\Shared\RentedSpan\RentedSpan.cs (1)
57_rentedBuffer = ArrayPool<T>.Shared.Rent(length);
Microsoft.Extensions.Configuration.Binder.SourceGeneration (1)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (1)
228T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
Microsoft.Extensions.Configuration.EnvironmentVariables (2)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
Microsoft.Extensions.DataIngestion (2)
Chunkers\ValueStringBuilder.cs (2)
33_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
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 (1)
parent\parent\parent\eng\MSBuild\parent\parent\src\Shared\RentedSpan\RentedSpan.cs (1)
57_rentedBuffer = ArrayPool<T>.Shared.Rent(length);
Microsoft.Extensions.DotNetDeltaApplier (9)
src\sdk\src\Dotnet.Watch\HotReloadAgent.Host\WebSocketTransport.cs (1)
98var buffer = ArrayPool<byte>.Shared.Rent(4096);
src\sdk\src\Dotnet.Watch\HotReloadAgent.PipeRpc\StreamExtensions.cs (8)
28var buffer = ArrayPool<byte>.Shared.Rent(minimumLength: size); 43var buffer = ArrayPool<byte>.Shared.Rent(minimumLength: size); 67var buffer = ArrayPool<byte>.Shared.Rent(minimumLength: size); 114var buffer = ArrayPool<byte>.Shared.Rent(minimumLength: size); 129var buffer = ArrayPool<byte>.Shared.Rent(minimumLength: size); 145var buffer = ArrayPool<byte>.Shared.Rent(minimumLength: size); 186var buffer = ArrayPool<byte>.Shared.Rent(minimumLength: size); 217var buffer = ArrayPool<byte>.Shared.Rent(minimumLength: size);
Microsoft.Extensions.Http.Diagnostics (2)
Logging\Internal\HttpRequestBodyReader.cs (1)
86var buffer = ArrayPool<byte>.Shared.Rent(readLimit);
Logging\Internal\HttpRequestReader.cs (1)
264var routeParams = ArrayPool<HttpRouteParameter>.Shared.Rent(routeSegments.ParameterCount);
Microsoft.Extensions.Logging.Abstractions (2)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
Microsoft.Extensions.Logging.Console (6)
JsonConsoleFormatter.cs (1)
105var logMessageBuffer = ArrayPool<char>.Shared.Rent(Encoding.UTF8.GetMaxCharCount(messageBytes.Length));
src\runtime\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\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
Microsoft.Extensions.Logging.Generators (1)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (1)
228T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
Microsoft.Extensions.Options.Contextual (1)
Internal\ContextualOptionsFactory.cs (1)
77var loadTasks = ArrayPool<ValueTask<IConfigureContextualOptions<TOptions>>>.Shared.Rent(_loaders.Length);
Microsoft.Extensions.ServiceDiscovery.Dns (5)
Resolver\DnsResolver.cs (5)
704byte[] buffer = ArrayPool<byte>.Shared.Rent(2048); 734var buffer = ArrayPool<byte>.Shared.Rent(512); 783var buffer = ArrayPool<byte>.Shared.Rent(8 * 1024); 815var largerBuffer = ArrayPool<byte>.Shared.Rent(responseLength + 2); 910byte[] 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 (3)
Logging\JustInTimeRedactor.cs (2)
131a = ArrayPool<char>.Shared.Rent(maxLenToRedact); 157var t = ArrayPool<char>.Shared.Rent(redactedLen);
parent\parent\parent\eng\MSBuild\parent\parent\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\aspnetcore\src\Components\Shared\src\ArrayBuilder.cs (1)
184var 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 (87)
Model\BPETokenizer.cs (7)
840byte[] bytes = ArrayPool<byte>.Shared.Rent(BufferLength << 1); 1326tokenBuffer = ArrayPool<char>.Shared.Rent(destinationMaxSize); 1329mappingBuffer = ArrayPool<int>.Shared.Rent(destinationMaxSize); 1439tokenBuffer = ArrayPool<char>.Shared.Rent(destinationMaxSize); 1442mappingBuffer = ArrayPool<int>.Shared.Rent(destinationMaxSize); 1519tokenBuffer = ArrayPool<char>.Shared.Rent(destinationMaxSize); 1522mappingBuffer = 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)
326charPoolArray ??= ArrayPool<char>.Shared.Rent(Math.Max(len, ApproximatedMaxEncodedBytesCount >> 1)); 348bytesPoolArray ??= ArrayPool<byte>.Shared.Rent(ApproximatedMaxEncodedBytesCount); 664charPoolArray ??= ArrayPool<char>.Shared.Rent(Math.Max(len, ApproximatedMaxEncodedBytesCount >> 1)); 702bytesPoolArray ??= 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)
387int[] buffer = ArrayPool<int>.Shared.Rent(textToEncode.Length * 3); 390char[] normalizedString = ArrayPool<char>.Shared.Rent(textToEncode.Length + 2); 424char[] utf16NormalizedString = ArrayPool<char>.Shared.Rent(normalizedString.Length << 1); 441char[] utf16NormalizedString = ArrayPool<char>.Shared.Rent(normalizedString.Length << 1); 620BestPathNode[] bestPathEndsAt = ArrayPool<BestPathNode>.Shared.Rent(normalizationSpan.Length + 1); 862int[] buffer = ArrayPool<int>.Shared.Rent(textToEncode.Length * 3); 865char[]? normalizedString = maxTokenCount == int.MaxValue ? null : ArrayPool<char>.Shared.Rent(textToEncode.Length + 2); 1071BestPathNode[] bestPathEndsAt = ArrayPool<BestPathNode>.Shared.Rent(normalizationSpan.Length + 1); 1094unknownTokensTracking = ArrayPool<(int IdsIndex, int Utf8Index, int Utf8Length)>.Shared.Rent(10); 1262int[] buffer = ArrayPool<int>.Shared.Rent(textToEncode.Length * 3); 1265char[]? normalizedString = maxTokenCount == int.MaxValue ? null : ArrayPool<char>.Shared.Rent(textToEncode.Length + 2); 1412BestPathNode[] bestPathEndsAt = ArrayPool<BestPathNode>.Shared.Rent(normalizationSpan.Length + 1); 1418(int Id, int UtfStartOffset, int Utf8Length)[] ids = ArrayPool<(int Id, int UtfStartOffset, int Utf8Length)>.Shared.Rent(bestPathEndsAt.Length); 1539int[] buffer = ArrayPool<int>.Shared.Rent(textToEncode.Length * 3); 1542char[]? normalizedString = maxTokenCount == int.MaxValue ? null : ArrayPool<char>.Shared.Rent(textToEncode.Length + 2); 1673BestPathNode[] 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 (4)
116byte[] inputArray = ArrayPool<byte>.Shared.Rent(Encoding.UTF8.GetMaxByteCount(text.Length)); 117byte[]? poolArray = ArrayPool<byte>.Shared.Rent(Math.Max(64, Encoding.UTF8.GetMaxByteCount(text.Length) * 2)); 185buffer = ArrayPool<char>.Shared.Rent(spanLength); 401byte[] chainedBytes = ArrayPool<byte>.Shared.Rent(Encoding.UTF8.GetMaxByteCount(chained.Length));
Normalizer\UpperCaseNormalizer.cs (1)
45char[] arrayPoolArray = ArrayPool<char>.Shared.Rent(original.Length);
PreTokenizer\CompositePreTokenizer.cs (1)
151char[] buffer = ArrayPool<char>.Shared.Rent(text.Length);
PreTokenizer\PreTokenizer.cs (1)
136char[] buffer = ArrayPool<char>.Shared.Rent(text.Length);
PreTokenizer\RegexPreTokenizer.cs (1)
104char[] 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 (3)
36(arrayPoolArray = ArrayPool<(int, int)>.Shared.Rent(requiredLength)); 159State[] statePoolArray = ArrayPool<State>.Shared.Rent(stateLength); 248var resultPoolArray = ArrayPool<(int Id, int TokenIndex, int TokenLength)>.Shared.Rent(mergingBytes.Length);
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.Build.Tasks (2)
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadManifestReader.SystemTextJson.cs (2)
53buffer = ArrayPool<byte>.Shared.Rent(segmentSize); 89var newBuffer = ArrayPool<byte>.Shared.Rent(newSegmentSize);
Microsoft.Net.Http.Headers (2)
ContentDispositionHeaderValue.cs (2)
551: bufferFromPool = ArrayPool<byte>.Shared.Rent(requiredLength); 719unescapedBytes = ArrayPool<byte>.Shared.Rent(dataString.Length);
Microsoft.NET.Sdk.WorkloadManifestReader (2)
WorkloadManifestReader.SystemTextJson.cs (2)
53buffer = ArrayPool<byte>.Shared.Rent(segmentSize); 89var newBuffer = ArrayPool<byte>.Shared.Rent(newSegmentSize);
Microsoft.Private.Windows.Core (9)
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\IO\BinaryReaderExtensions.cs (1)
26byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length);
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\IO\StreamExtensions.cs (2)
31byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length); 56byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length);
System\BufferScope.cs (3)
24_array = ArrayPool<T>.Shared.Rent(minimumLength); 66_array = ArrayPool<T>.Shared.Rent(minimumLength); 88T[] newArray = ArrayPool<T>.Shared.Rent(capacity);
System\Text\ValueStringBuilder.cs (3)
27_chars = ArrayPool<char>.Shared.Rent( 41_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 334char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
Microsoft.Win32.Registry (5)
Microsoft\Win32\RegistryKey.cs (5)
863char[]? name = ArrayPool<char>.Shared.Rent(100); 918name = ArrayPool<char>.Shared.Rent(checked(oldLength * 2)); 1006span = pooledArray = ArrayPool<byte>.Shared.Rent(65_000); 1056span = pooledArray = ArrayPool<byte>.Shared.Rent(dataLength); 1110byte[] newPooled = ArrayPool<byte>.Shared.Rent(dataLength + 1);
NuGet.Common (1)
MsBuildStringUtility.cs (1)
112logCodes ??= ArrayPool<NuGetLogCode>.Shared.Rent(split.Length);
NuGet.Packaging (3)
Signing\Archive\SignedPackageArchiveIOUtility.cs (3)
56byte[] buffer = ArrayPool<byte>.Shared.Rent(_bufferSize); 96byte[] buffer = ArrayPool<byte>.Shared.Rent(_bufferSize); 167byte[] buffer = ArrayPool<byte>.Shared.Rent(_bufferSize);
NuGet.ProjectModel (6)
JsonPackageSpecReader.Utf8JsonStreamReader.cs (2)
1170items = ArrayPool<NuGetLogCode>.Shared.Rent(16); 1176items = ArrayPool<NuGetLogCode>.Shared.Rent(items.Length * 2);
src\nuget-client\build\Shared\Utf8JsonStreamReader.cs (4)
57_buffer = _bufferPool.Rent(bufferSize); 216strings = ArrayPool<string>.Shared.Rent(16); 222strings = ArrayPool<string>.Shared.Rent(strings.Length * 2); 347_buffer = _bufferPool.Rent(_buffer.Length * 2);
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\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
115byte[] buffer = ArrayPool<byte>.Shared.Rent(4096); 160byte[] buffer = ArrayPool<byte>.Shared.Rent(4096);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\InterceptsLocationUtilities.cs (1)
92: System.Buffers.ArrayPool<byte>.Shared.Rent(decodedLength);
Shared (7)
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\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)
65int[] arrayPoolBuckets = ArrayPool<int>.Shared.Rent(numBuckets + hashCodes.Length); 229int[] 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)
45int[] 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\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] 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\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System.Diagnostics.PerformanceCounter (1)
System\Diagnostics\PerformanceDataRegistryKey.cs (1)
118? ArrayPool<byte>.Shared.Rent(size)
System.Diagnostics.Process (16)
src\runtime\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\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (1)
71arrayBuffer = ArrayPool<byte>.Shared.Rent(spanBuffer.Length * 2);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System\Diagnostics\Process.Linux.cs (1)
234byte[] tmp = ArrayPool<byte>.Shared.Rent((int)newLength);
System\Diagnostics\Process.Multiplexing.cs (6)
48byte[] outputBuffer = ArrayPool<byte>.Shared.Rent(InitialReadAllBufferSize); 49byte[] errorBuffer = ArrayPool<byte>.Shared.Rent(InitialReadAllBufferSize); 97byte[] outputBuffer = ArrayPool<byte>.Shared.Rent(InitialReadAllBufferSize); 98byte[] errorBuffer = ArrayPool<byte>.Shared.Rent(InitialReadAllBufferSize); 484byte[] buffer = ArrayPool<byte>.Shared.Rent(InitialReadAllBufferSize); 674T[] newBuffer = ArrayPool<T>.Shared.Rent(newSize);
System\Diagnostics\Process.Multiplexing.Unix.cs (4)
31byte[] outputByteBuffer = ArrayPool<byte>.Shared.Rent(InitialReadAllBufferSize); 32byte[] errorByteBuffer = ArrayPool<byte>.Shared.Rent(InitialReadAllBufferSize); 33char[] outputCharBuffer = ArrayPool<char>.Shared.Rent(InitialReadAllBufferSize); 34char[] errorCharBuffer = ArrayPool<char>.Shared.Rent(InitialReadAllBufferSize);
System.Drawing.Common (1)
System\Drawing\Icon.cs (1)
168char[] buffer = ArrayPool<char>.Shared.Rent(Math.Max((int)PInvokeCore.MAX_PATH, filePath.Length));
System.Formats.Asn1 (1)
src\runtime\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)
163byte[] tempBuffer = s_bufferPool.Rent(totalMapPayloadEncodingLength);
System\Formats\Cbor\Writer\CborWriter.String.cs (1)
213byte[] 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 (17)
src\runtime\src\libraries\Common\src\System\IO\Archiving.Utils.cs (1)
24buffer = ArrayPool<char>.Shared.Rent(newCapacity);
src\runtime\src\libraries\Common\src\System\IO\SubReadStream.cs (2)
113byte[] buffer = ArrayPool<byte>.Shared.Rent((int)Math.Min(MaxAdvanceBufferLength, bytesToDiscard)); 140byte[] buffer = ArrayPool<byte>.Shared.Rent((int)Math.Min(MaxAdvanceBufferLength, bytesToDiscard));
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System\Formats\Tar\GnuSparseStream.cs (3)
174byte[] rented = ArrayPool<byte>.Shared.Rent(toRead); 290byte[] buffer = ArrayPool<byte>.Shared.Rent(81920); 448byte[] bytes = ArrayPool<byte>.Shared.Rent(bufferSize);
System\Formats\Tar\TarHeader.Read.cs (3)
26byte[] rented = ArrayPool<byte>.Shared.Rent(minimumLength: TarHelpers.RecordSize); 663byte[] buffer = ArrayPool<byte>.Shared.Rent((int)_size); 715byte[] buffer = ArrayPool<byte>.Shared.Rent((int)_size);
System\Formats\Tar\TarHeader.Write.cs (2)
808byte[] buffer = ArrayPool<byte>.Shared.Rent(paddingAfterData); 862span = buffer = ArrayPool<byte>.Shared.Rent(length);
System\Formats\Tar\TarHelpers.cs (2)
63byte[] buffer = ArrayPool<byte>.Shared.Rent(minimumLength: (int)Math.Min(MaxBufferLength, bytesToDiscard)); 86byte[] buffer = ArrayPool<byte>.Shared.Rent(minimumLength: (int)Math.Min(MaxBufferLength, bytesToCopy));
System\Formats\Tar\TarWriter.cs (2)
344byte[] rented = ArrayPool<byte>.Shared.Rent(minimumLength: TarHelpers.RecordSize); 376byte[] twoEmptyRecords = ArrayPool<byte>.Shared.Rent(TwoRecordSize);
System.IO.Compression (19)
src\runtime\src\libraries\Common\src\System\IO\SubReadStream.cs (2)
113byte[] buffer = ArrayPool<byte>.Shared.Rent((int)Math.Min(MaxAdvanceBufferLength, bytesToDiscard)); 140byte[] buffer = ArrayPool<byte>.Shared.Rent((int)Math.Min(MaxAdvanceBufferLength, bytesToDiscard));
src\runtime\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\IO\Compression\DeflateZLib\DeflateStream.cs (2)
150_buffer = ArrayPool<byte>.Shared.Rent(DefaultBufferSize); 938_arrayPoolBuffer = ArrayPool<byte>.Shared.Rent(bufferSize);
System\IO\Compression\WinZipAesKeyMaterial.cs (1)
65byte[] rentedPasswordBytes = ArrayPool<byte>.Shared.Rent(maxPasswordByteCount);
System\IO\Compression\ZipArchive.Async.cs (1)
217byte[] arrayPoolArray = ArrayPool<byte>.Shared.Rent(ReadCentralDirectoryReadBufferSize);
System\IO\Compression\ZipArchive.cs (1)
663byte[] arrayPoolArray = ArrayPool<byte>.Shared.Rent(ReadCentralDirectoryReadBufferSize);
System\IO\Compression\ZipBlocks.Async.cs (2)
144byte[] arrayPoolBuffer = ArrayPool<byte>.Shared.Rent(extraFieldLength); 213arrayPoolBuffer = ArrayPool<byte>.Shared.Rent(dynamicHeaderSize);
System\IO\Compression\ZipBlocks.cs (2)
643byte[]? arrayPoolBuffer = extraFieldLength > StackAllocationThreshold ? ArrayPool<byte>.Shared.Rent(extraFieldLength) : null; 1023arrayPoolBuffer = ArrayPool<byte>.Shared.Rent(dynamicHeaderSize);
System\IO\Compression\ZipCryptoStream.cs (1)
129byte[] passwordBytes = ArrayPool<byte>.Shared.Rent(Encoding.UTF8.GetMaxByteCount(password.Length));
System\IO\Compression\ZipHelper.Async.cs (1)
31byte[] buffer = ArrayPool<byte>.Shared.Rent(BackwardsSeekingBufferSize);
System\IO\Compression\ZipHelper.cs (1)
105byte[] buffer = ArrayPool<byte>.Shared.Rent(BackwardsSeekingBufferSize);
System\IO\Compression\Zstandard\ZstandardDictionary.cs (2)
105byte[] lengthsArray = ArrayPool<byte>.Shared.Rent(sampleLengths.Length * sizeof(nuint)); 131dictionaryBuffer = ArrayPool<byte>.Shared.Rent(maxDictionarySize);
System.IO.Compression.Brotli (1)
System\IO\Compression\BrotliStream.cs (1)
59_buffer = ArrayPool<byte>.Shared.Rent(DefaultInternalBufferSize);
System.IO.Compression.ZipFile (1)
src\runtime\src\libraries\Common\src\System\IO\Archiving.Utils.cs (1)
24buffer = ArrayPool<char>.Shared.Rent(newCapacity);
System.IO.FileSystem.AccessControl (2)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System.IO.FileSystem.Watcher (2)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System.IO.Packaging (1)
System\IO\Packaging\InterleavedZipPackagePartStream.cs (1)
546byte[] readBuffer = ArrayPool<byte>.Shared.Rent(BufferSize);
System.IO.Pipelines (4)
System\IO\Pipelines\Pipe.cs (2)
288segment.SetOwnedMemory(ArrayPool<byte>.Shared.Rent(sizeToRequest)); 310: ArrayPool<byte>.Shared.Rent(GetSegmentSize(sizeHint));
System\IO\Pipelines\StreamPipeReader.cs (1)
526nextSegment.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\runtime\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\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackDecoder.cs (2)
678buffer = Pool.Rent(requiredLength); 682byte[] newBuffer = Pool.Rent(requiredLength);
src\runtime\src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (1)
231_blocks[allocatedBlockCount++] = ArrayPool<byte>.Shared.Rent(BlockSize);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System\Net\Http\Headers\HeaderDescriptor.cs (1)
313char[] 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)
183byte[] buffer = ArrayPool<byte>.Shared.Rent((int)stream.Length); 997newBuffer = ArrayPool<byte>.Shared.Rent(newBufferCapacity); 1017newBuffer = ArrayPool<byte>.Shared.Rent(newBufferCapacity);
System\Net\Http\MultipartContent.cs (1)
641: (rentedBuffer = ArrayPool<byte>.Shared.Rent(maxLength));
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http1.cs (1)
443HttpConnection[] 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)
2001byte[] pooledBuffer = ArrayPool<byte>.Shared.Rent(desiredBufferSize);
System\Net\Http\SocketsHttpHandler\SocksHelper.cs (2)
68byte[] buffer = ArrayPool<byte>.Shared.Rent(BufferSize); 216byte[] buffer = ArrayPool<byte>.Shared.Rent(BufferSize);
System.Net.Http.WinHttpHandler (3)
System\Net\Http\WinHttpResponseParser.cs (1)
32char[] buffer = ArrayPool<char>.Shared.Rent(bufferLength);
System\Net\Http\WinHttpResponseStream.cs (2)
104return CopyToAsyncCore(destination, ArrayPool<byte>.Shared.Rent(bufferSize), cancellationToken); 278char[] trailersBuffer = ArrayPool<char>.Shared.Rent(bufferLength);
System.Net.Mail (2)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System.Net.NameResolution (7)
System\Net\DnsResolverPal.Managed.cs (7)
397byte[] queryBytes = ArrayPool<byte>.Shared.Rent(MaxUdpResponseSize); 404byte[] responseBuffer = ArrayPool<byte>.Shared.Rent(MaxUdpResponseSize); 486responseBuffer = ArrayPool<byte>.Shared.Rent(MaxUdpResponseSize); 701byte[] buffer = ArrayPool<byte>.Shared.Rent(InitialTcpBufferSize); 714buffer = ArrayPool<byte>.Shared.Rent(responseLength); 738byte[] buffer = ArrayPool<byte>.Shared.Rent(InitialTcpBufferSize); 751buffer = ArrayPool<byte>.Shared.Rent(responseLength);
System.Net.Primitives (1)
src\runtime\src\libraries\Common\src\System\Net\NetworkInformation\InterfaceInfoPal.Unix.cs (1)
47: (rentedBuffer = ArrayPool<byte>.Shared.Rent(bufferSize)))
System.Net.Quic (8)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
35byte[] buffer = ArrayPool<byte>.Shared.Rent(1024);
src\runtime\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\runtime\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 (20)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
35byte[] buffer = ArrayPool<byte>.Shared.Rent(1024);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (2)
621byte[] buffer = ArrayPool<byte>.Shared.Rent(512); 680buffer = ArrayPool<byte>.Shared.Rent(buffer.Length * 2);
src\runtime\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\runtime\src\libraries\Common\src\System\Net\Security\RC4.cs (1)
46state = ArrayPool<byte>.Shared.Rent(256);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
13internal static byte[] Rent(int minimumLength) => ArrayPool<byte>.Shared.Rent(minimumLength);
src\runtime\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\NegotiateAuthentication.cs (1)
282rentedBuffer = ArrayPool<byte>.Shared.Rent((incomingBlob.Length / 4) * 3);
System\Net\Security\SslStream.Protocol.cs (2)
1567Payload = RentBuffer ? ArrayPool<byte>.Shared.Rent(Size) : new byte[Size]; 1581Payload = 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\Security\TlsSession.cs (5)
1175byte[] rented = ArrayPool<byte>.Shared.Rent(chunk); 1579_decryptScratch = ArrayPool<byte>.Shared.Rent(size); 1961byte[] scratch = ArrayPool<byte>.Shared.Rent(SocketScratchSize); 2170byte[] scratch = ArrayPool<byte>.Shared.Rent(SocketScratchSize); 2255byte[] scratch = ArrayPool<byte>.Shared.Rent(SocketScratchSize);
System.Net.ServerSentEvents (6)
src\runtime\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)
107_lineBuffer = ArrayPool<byte>.Shared.Rent(DefaultArrayPoolRentSize); 187_lineBuffer = ArrayPool<byte>.Shared.Rent(DefaultArrayPoolRentSize); 565buffer = 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)
1469byte[] closeBuffer = ArrayPool<byte>.Shared.Rent(MaxMessageHeaderLength + MaxControlPayloadLength); 1554buffer = ArrayPool<byte>.Shared.Rent(count); 1559buffer = ArrayPool<byte>.Shared.Rent(count); 1645_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 (12)
System\Numerics\Tensors\netcore\Tensor.cs (5)
257T[] tempBuffer = ArrayPool<T>.Shared.Rent((int)totalLength); 3659T[] flat = ArrayPool<T>.Shared.Rent((int)x.FlattenedLength); 3691T[] flat = ArrayPool<T>.Shared.Rent((int)x.FlattenedLength); 3722T[] flat = ArrayPool<T>.Shared.Rent((int)x.FlattenedLength); 3755T[] flat = ArrayPool<T>.Shared.Rent((int)x.FlattenedLength);
System\Numerics\Tensors\netcore\TensorOperation.cs (2)
369: (resultLengthsArray = ArrayPool<nint>.Shared.Rent(maxRank)); 2758rentedBuffer._array = ArrayPool<T>.Shared.Rent(rank);
System\Numerics\Tensors\netcore\TensorShape.cs (5)
165stridesOrderArray = ArrayPool<int>.Shared.Rent(rank); 710lengthsArray = ArrayPool<nint>.Shared.Rent(rank); 767intermediateLengthsArray = ArrayPool<nint>.Shared.Rent(rank); 1122intermediateLengthsArray = ArrayPool<nint>.Shared.Rent(rank); 1125intermediateStridesArray = ArrayPool<nint>.Shared.Rent(rank);
System.Private.CoreLib (80)
src\runtime\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\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetCwd.cs (1)
31byte[] buf = ArrayPool<byte>.Shared.Rent(bufferSize);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (1)
71arrayBuffer = ArrayPool<byte>.Shared.Rent(spanBuffer.Length * 2);
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (1)
228T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
src\runtime\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 70/// <see cref="Return"/> so that it may be reused in subsequent usage of <see cref="Rent"/>. 78/// Returns to the pool an array that was previously obtained via <see cref="Rent"/> on the same 82/// The buffer previously obtained from <see cref="Rent"/> to return to the pool. 86/// will clear <paramref name="array"/> of its contents so that a subsequent consumer via <see cref="Rent"/> 92/// and must not use it. The reference returned from a given call to <see cref="Rent"/> must only be
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Decoder.cs (2)
109: (rented = ArrayPool<byte>.Shared.Rent(upperBound)); 241: (rented = ArrayPool<byte>.Shared.Rent(upperBound));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlDecoder.cs (2)
169: (rented = ArrayPool<byte>.Shared.Rent(upperBound)); 267: (rented = ArrayPool<byte>.Shared.Rent(upperBound));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Icu.cs (2)
886: (borrowedArray = ArrayPool<byte>.Shared.Rent(sortKeyLength)); 911sortKey = (borrowedArray = ArrayPool<byte>.Shared.Rent(sortKeyLength));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (1)
146(borrowedArr = ArrayPool<byte>.Shared.Rent(sortKeyLength));
src\runtime\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\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\IO\BinaryReader.cs (1)
525byte[] buffer = ArrayPool<byte>.Shared.Rent(numBytes);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\BinaryWriter.cs (5)
198rented = ArrayPool<byte>.Shared.Rent(maxByteCount); 370byte[] rented = ArrayPool<byte>.Shared.Rent(value.Length * 3); // max expansion: each char -> 3 bytes 395byte[] array = ArrayPool<byte>.Shared.Rent(buffer.Length); 433rented = ArrayPool<byte>.Shared.Rent(maxByteCount); 446rented = ArrayPool<byte>.Shared.Rent(MaxArrayPoolRentalSize);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerator.Unix.cs (1)
58_pathBuffer = ArrayPool<char>.Shared.Rent(StandardBufferSize);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\File.cs (6)
1133buffer = ArrayPool<char>.Shared.Rent(sr.CurrentEncoding.GetMaxCharCount(DefaultBufferSize)); 1250byte[] rentedArray = ArrayPool<byte>.Shared.Rent(512); 1264byte[] tmp = ArrayPool<byte>.Shared.Rent((int)newLength); 1529byte[] tmp = ArrayPool<byte>.Shared.Rent((int)newLength); 1577Span<byte> bytes = (uint)bytesNeeded <= 1024 ? stackalloc byte[1024] : (rentedBytes = ArrayPool<byte>.Shared.Rent(bytesNeeded)); 1631byte[] bytes = ArrayPool<byte>.Shared.Rent(preambleSize + encoding.GetMaxByteCount(Math.Min(contents.Length, ChunkSize)));
src\runtime\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); 316byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length); 740byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length); 785byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length); 917byte[] sharedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (2)
989arrayPoolBuffer = ArrayPool<char>.Shared.Rent(charLen - charPos + 80); 993char[] newBuffer = ArrayPool<char>.Shared.Rent(checked(arrayPoolBufferPos + charLen - charPos));
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.cs (2)
192char[] array = ArrayPool<char>.Shared.Rent(buffer.Length); 416char[] array = ArrayPool<char>.Shared.Rent(buffer.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Marvin.OrdinalIgnoreCase.cs (1)
87Span<char> scratch = (uint)count <= 64 ? stackalloc char[64] : (borrowedArr = ArrayPool<char>.Shared.Rent(count));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.DecimalIeee754.DiyFp128DecimalReduce.cs (1)
157: (rented = ArrayPool<ulong>.Shared.Rent(maxWords));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\INumberBase.cs (5)
319utf16TextArray = ArrayPool<char>.Shared.Rent(textMaxCharCount); 501utf16TextArray = ArrayPool<char>.Shared.Rent(textMaxCharCount); 571utf16DestinationArray = ArrayPool<char>.Shared.Rent(destinationMaxCharCount); 627utf16TextArray = ArrayPool<char>.Shared.Rent(textMaxCharCount); 674utf16TextArray = ArrayPool<char>.Shared.Rent(textMaxCharCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.cs (3)
215: rented = ArrayPool<byte>.Shared.Rent(byteCount); 351: rented = ArrayPool<byte>.Shared.Rent(byteCount); 390: rented = ArrayPool<byte>.Shared.Rent(byteCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncProfiler.cs (1)
1878rentedArray = ArrayPool<byte>.Shared.Rent(minimumLength);
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMapState.cs (1)
169bool[] seen = ArrayPool<bool>.Shared.Rent(modulus);
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (1)
1003(borrowedArr = ArrayPool<char>.Shared.Rent(length + 1));
src\runtime\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\runtime\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);
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Cache.cs (2)
506T[] tmp = ArrayPool<T>.Shared.Rent(Math.Max(arrayPoolArray.Length * 2, requiredCapacity)); 652TimeTransition[] allTransitions = ArrayPool<TimeTransition>.Shared.Rent(InitialTransitionsCount);
System.Private.CoreLib.Generators (1)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (1)
228T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
System.Private.Uri (3)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (1)
228T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System.Private.Windows.Core (6)
System\BufferScope.cs (3)
24_array = ArrayPool<T>.Shared.Rent(minimumLength); 66_array = ArrayPool<T>.Shared.Rent(minimumLength); 88T[] newArray = ArrayPool<T>.Shared.Rent(capacity);
System\Text\ValueStringBuilder.cs (3)
27_chars = ArrayPool<char>.Shared.Rent( 41_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 334char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System.Private.Xml (2)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System.Reflection.Metadata (3)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System\Reflection\Internal\Utilities\EncodingHelper.cs (1)
45byte[] buffer = ArrayPool<byte>.Shared.Rent(prefixedByteCount);
System.Runtime.Numerics (15)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (1)
228T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder_1.cs (2)
34_arrayToReturnToPool = ArrayPool<TChar>.Shared.Rent(initialCapacity); 299TChar[] poolArray = ArrayPool<TChar>.Shared.Rent(newCapacity);
System\Number.BigInteger.cs (4)
118buffer = arrayFromPool = ArrayPool<byte>.Shared.Rent(value.Length + 1 + 1); 626bits = arrayToReturnToPool = ArrayPool<byte>.Shared.Rent(bytesWrittenOrNeeded); 710bytes = arrayToReturnToPool = ArrayPool<byte>.Shared.Rent(bytesWrittenOrNeeded); 933(numberBufferToReturn = ArrayPool<byte>.Shared.Rent(valueDigits + 1));
System\Numerics\BigInteger.RentedBuffer.cs (1)
37nuint[] array = ArrayPool<nuint>.Shared.Rent(size);
System\Numerics\BigIntegerCalculator.PowMod.cs (1)
552nuint[] tablePool = ArrayPool<nuint>.Shared.Rent(totalTableLen);
System\Numerics\BigIntegerCalculator.SquMul.cs (6)
73nuint[] pAndQAllFromPool = ArrayPool<nuint>.Shared.Rent(pAndQAllLength); 82nuint[] rAndZAllFromPool = ArrayPool<nuint>.Shared.Rent(rAndZAllLength); 282nuint[] pAndQAllFromPool = ArrayPool<nuint>.Shared.Rent(pAndQAllLength); 292nuint[] rAndZAllFromPool = ArrayPool<nuint>.Shared.Rent(rAndZAllLength); 329nuint[] pAndQAllFromPool = ArrayPool<nuint>.Shared.Rent(pAndQAllLength); 365nuint[] cAllFromPool = ArrayPool<nuint>.Shared.Rent(cAllLength);
System.Security.Cryptography (29)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
13internal static byte[] Rent(int minimumLength) => ArrayPool<byte>.Shared.Rent(minimumLength);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (3)
918_certBags = ArrayPool<SafeBagAsn>.Shared.Rent(loaderLimits.MaxCertificates.GetValueOrDefault(10)); 919_keyBags = ArrayPool<SafeBagAsn>.Shared.Rent(loaderLimits.MaxKeys.GetValueOrDefault(10)); 1075SafeBagAsn[] next = ArrayPool<SafeBagAsn>.Shared.Rent(checked(index + 1));
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System\Security\Cryptography\CngAsnFormatter.cs (1)
35(pooledarray = ArrayPool<char>.Shared.Rent(charLength));
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); 1408byte[] 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.Cose (8)
System\Security\Cryptography\Cose\CoseMessage.cs (2)
458byte[] contentBuffer = ArrayPool<byte>.Shared.Rent(4096); 494byte[] 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)
784byte[] buffer = ArrayPool<byte>.Shared.Rent(bufferLength); 938byte[] buffer = ArrayPool<byte>.Shared.Rent(bufferLength);
System\Security\Cryptography\Cose\CoseSignature.cs (2)
625byte[] buffer = ArrayPool<byte>.Shared.Rent(bufferLength); 658byte[] buffer = ArrayPool<byte>.Shared.Rent(bufferLength);
System.Security.Cryptography.Pkcs (1)
src\runtime\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.ServiceProcess.ServiceController (2)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System.Text.Encodings.Web (3)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] 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 (106)
src\runtime\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\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
src\runtime\src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (2)
48: (rentedBuffer = ArrayPool<char>.Shared.Rent(initialBufferLength)); 188char[] newBuffer = ArrayPool<char>.Shared.Rent(newSize);
System\Text\Json\Document\JsonDocument.cs (2)
314(otherUtf8TextArray = ArrayPool<byte>.Shared.Rent(length)); 827byte[] 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); 250_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); 811rented = ArrayPool<byte>.Shared.Rent(checked((int)expectedLength)); 815rented = ArrayPool<byte>.Shared.Rent(UnseekableStreamInitialRentSize); 846rented = ArrayPool<byte>.Shared.Rent(checked(toReturn.Length * 2)); 894rented = ArrayPool<byte>.Shared.Rent(checked((int)expectedLength)); 898rented = ArrayPool<byte>.Shared.Rent(UnseekableStreamInitialRentSize); 926rented = 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)
208(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)
59: (rentedByteBuffer = ArrayPool<byte>.Shared.Rent(bufferLength));
System\Text\Json\Serialization\Converters\Value\Ieee754FloatingPointConverter.cs (2)
148: (rentedByteBuffer = ArrayPool<byte>.Shared.Rent(bufferLength)); 272rented = ArrayPool<byte>.Shared.Rent(destination.Length * 2);
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (1)
54: (rentedBuffer = ArrayPool<byte>.Shared.Rent(bufferLength));
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (1)
54: (rentedBuffer = ArrayPool<byte>.Shared.Rent(bufferLength));
System\Text\Json\Serialization\Converters\Value\VersionConverter.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\JsonUnionTypeStructuralClassifier.cs (2)
396: (rentedPocoCaseStates = ArrayPool<PocoObjectCaseState>.Shared.Rent(_pocoObjectCases.Length)); 502: (rentedPropertyName = ArrayPool<byte>.Shared.Rent(bufferLength));
System\Text\Json\Serialization\StreamReadBufferState.cs (2)
46_buffer = ArrayPool<byte>.Shared.Rent(Math.Max(initialBufferSize, JsonConstants.Utf8Bom.Length)); 139byte[] newBuffer = ArrayPool<byte>.Shared.Rent((_buffer.Length < (int.MaxValue / 2)) ? _buffer.Length * 2 : int.MaxValue);
System\Text\Json\Writer\JsonWriterHelper.cs (2)
316? (rented = ArrayPool<byte>.Shared.Rent(quotedLength)).AsSpan(0, quotedLength) 346rented = ArrayPool<byte>.Shared.Rent(length);
System\Text\Json\Writer\Utf8JsonWriter.cs (2)
870(propertyArray = ArrayPool<byte>.Shared.Rent(length)); 1019(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)
192(valueArray = ArrayPool<char>.Shared.Rent(length)); 343(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\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (1)
228T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
src\runtime\src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (2)
48: (rentedBuffer = ArrayPool<char>.Shared.Rent(initialBufferLength)); 188char[] newBuffer = ArrayPool<char>.Shared.Rent(newSize);
System.Text.RegularExpressions (5)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (1)
228T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
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\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (1)
228T[] array = ArrayPool<T>.Shared.Rent(nextCapacity);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System.Web.HttpUtility (4)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (2)
29_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity); 265char[] poolArray = ArrayPool<char>.Shared.Rent(newCapacity);
System\Web\Util\HttpEncoder.cs (2)
570byte[] bytes = ArrayPool<byte>.Shared.Rent(Encoding.UTF8.GetMaxByteCount(toEncode.Length)); 572char[] chars = ArrayPool<char>.Shared.Rent(utf8Length * 3);