25 references to Shared
Microsoft.Build (5)
Evaluation\Conditionals\NodeStateStore.cs (2)
46StringNodeState[] states = _stringStates ??= BufferPool<StringNodeState>.Shared.Rent(_layout.StringSlotCount); 60BufferPool<StringNodeState>.Shared.Return(stringStates);
Logging\BinaryLogger\Postprocessing\StreamExtensions.cs (1)
31using var _ = BufferPool<byte>.Shared.Rent(4096, out byte[] buffer);
Logging\OptimizedStringIndenter.cs (2)
107BufferPool<StringSegment>.Shared.Return(pooledArray); 139pooledArray = BufferPool<StringSegment>.Shared.Rent(segmentCount);
Microsoft.Build.Framework (18)
BackEnd\InterningBinaryReader.cs (2)
144resultBuffer ??= BufferPool<char>.Shared.Rent(stringLength); // Actual string length in chars may be smaller. 165BufferPool<char>.Shared.Return(resultBuffer);
Utilities\BufferPool.cs (2)
15/// On .NET Framework, <see cref="Shared"/> caches one buffer per power-of-two size from 16 through 256 17/// <see cref="Shared"/> is <see cref="ArrayPool{T}.Shared"/>. The <see cref="Create()"/> and
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); 110T[] newArray = BufferPool<T>.Shared.Rent(capacity); 118BufferPool<T>.Shared.Return(_array, clearArray: TypeInfo<T>.IsReferenceOrContainsReferences()); 184/// Releases the rented array back to <see cref="BufferPool{T}.Shared"/> if one was rented. 193BufferPool<T>.Shared.Return(_array, clearArray: TypeInfo<T>.IsReferenceOrContainsReferences());
Utilities\ValueStringBuilder.cs (4)
55_arrayToReturnToPool = BufferPool<byte>.Shared.Rent(initialCapacity * sizeof(char)); 419byte[] poolArray = BufferPool<byte>.Shared.Rent(newCapacity * sizeof(char)); 428BufferPool<byte>.Shared.Return(toReturn); 451BufferPool<byte>.Shared.Return(toReturn);
Microsoft.Build.Tasks.Core (2)
Hash.cs (2)
70using var shaBufferScope = BufferPool<byte>.Shared.Rent(ShaBufferSize, out byte[] shaBuffer); 74using var itemSpecBufferScope = BufferPool<byte>.Shared.Rent(itemSpecChunkByteBufferSize, out byte[] itemSpecChunkByteBuffer);