ArrayPool<T>.Shared Property

Definition

Gets a shared ArrayPool<T> instance.

C#
public static System.Buffers.ArrayPool<T> Shared { get; }

Property Value

A shared ArrayPool<T> instance.

Remarks

The shared pool provides a default implementation of the ArrayPool<T> class that's intended for general applicability. A shared class maintains arrays of multiple sizes, and may hand back a larger array than was actually requested, but it will never hand back a smaller array than was requested. Renting a buffer from a shared class using the Rent method will result in an existing buffer being taken from the pool if an appropriate buffer is available or in a new buffer being allocated if one is not available.

Applies to

Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided), 2.1