DotNext by Roman Sakno

<PackageReference Include="DotNext" Version="1.0.0" />

 ArrayRental<T>

public struct ArrayRental<T> : IDisposable
Represents array obtained from array pool.
public bool IsEmpty { get; }

Gets value indicating that this object is empty.

public ref T this[long index] { get; }

Gets array element by its index.

public Memory<T> Memory { get; }

Gets memory associated with the rented array.

public ArrayRental(ArrayPool<T> pool, int minimumLength, bool clearArray = false)

Obtains a new array from array pool.

public ArrayRental(int minimumLength, bool clearArray = false)

Obtains a new array from Shared.

public static T[] op_Implicit(ref ArrayRental rental)

Obtains rented array.

public void Dispose()

Returns array to the pool.

public ref T GetPinnableReference()

Obtains managed pointer to the first element of the rented array.