DotNext by Roman Sakno

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

 MemoryAllocator

public static class MemoryAllocator
Represents interop layer between .NET memory pools and MemoryAllocator<T>.
public static MemoryAllocator<T> CreateArrayAllocator<T>()

Returns array allocator.

public static MemoryOwner<T> Invoke<T>(this MemoryAllocator<T> allocator, int length, bool exactSize)

Allocates memory.

public static MemoryAllocator<T> ToAllocator<T>(this ArrayPool<T> pool)

Converts array pool to the memory allocator.

public static MemoryAllocator<T> ToAllocator<T>(this MemoryPool<T> pool)

Converts memory pool to the memory allocator.

public static MemoryAllocator<T> ToAllocator<T>(this Func<int, IMemoryOwner<T>> provider)

Converts memory provider to the memory allocator.