25 references to BufferPool
Microsoft.Build (7)
BackEnd\Components\Scheduler\Scheduler.cs (2)
73
private ArrayPool<SchedulableRequest> _requestBufferPool =
BufferPool
<SchedulableRequest>.Create();
603
_requestBufferPool =
BufferPool
<SchedulableRequest>.Create();
Evaluation\Conditionals\NodeStateStore.cs (2)
46
StringNodeState[] states = _stringStates ??=
BufferPool
<StringNodeState>.Shared.Rent(_layout.StringSlotCount);
60
BufferPool
<StringNodeState>.Shared.Return(stringStates);
Logging\BinaryLogger\Postprocessing\StreamExtensions.cs (1)
31
using var _ =
BufferPool
<byte>.Shared.Rent(4096, out byte[] buffer);
Logging\OptimizedStringIndenter.cs (2)
107
BufferPool
<StringSegment>.Shared.Return(pooledArray);
139
pooledArray =
BufferPool
<StringSegment>.Shared.Rent(segmentCount);
Microsoft.Build.Framework (16)
BackEnd\InterningBinaryReader.cs (2)
144
resultBuffer ??=
BufferPool
<char>.Shared.Rent(stringLength); // Actual string length in chars may be smaller.
165
BufferPool
<char>.Shared.Return(resultBuffer);
Utilities\BufferScope.cs (10)
10
/// Allows renting a buffer from <see cref="
BufferPool
{T}.Shared"/> with a using statement. Can be used directly as if it
18
/// from <see cref="
BufferPool
{T}.Shared"/> only when the initial buffer is too small.
37
_array =
BufferPool
<T>.Shared.Rent(minimumLength);
64
/// from <see cref="
BufferPool
{T}.Shared"/>.
68
/// <see cref="
BufferPool
{T}.Shared"/>.
79
_array =
BufferPool
<T>.Shared.Rent(minimumLength);
110
T[] newArray =
BufferPool
<T>.Shared.Rent(capacity);
118
BufferPool
<T>.Shared.Return(_array, clearArray: TypeInfo<T>.IsReferenceOrContainsReferences());
184
/// Releases the rented array back to <see cref="
BufferPool
{T}.Shared"/> if one was rented.
193
BufferPool
<T>.Shared.Return(_array, clearArray: TypeInfo<T>.IsReferenceOrContainsReferences());
Utilities\ValueStringBuilder.cs (4)
55
_arrayToReturnToPool =
BufferPool
<byte>.Shared.Rent(initialCapacity * sizeof(char));
419
byte[] poolArray =
BufferPool
<byte>.Shared.Rent(newCapacity * sizeof(char));
428
BufferPool
<byte>.Shared.Return(toReturn);
451
BufferPool
<byte>.Shared.Return(toReturn);
Microsoft.Build.Tasks.Core (2)
Hash.cs (2)
70
using var shaBufferScope =
BufferPool
<byte>.Shared.Rent(ShaBufferSize, out byte[] shaBuffer);
74
using var itemSpecBufferScope =
BufferPool
<byte>.Shared.Rent(itemSpecChunkByteBufferSize, out byte[] itemSpecChunkByteBuffer);