DotNext.Unsafe by Roman Sakno

<PackageReference Include="DotNext.Unsafe" Version="3.2.1" />

 UnmanagedMemoryPool<T>

Represents pool of unmanaged memory.
public UnmanagedMemoryPool(int maxBufferSize, int defaultBufferSize = 32, bool trackAllocations = false)

Initializes a new pool of unmanaged memory.

public static IUnmanagedMemoryOwner<T> Allocate(int length, bool zeroMem = true)

Allocates unmanaged memory and returns an object that controls its lifetime.

public static MemoryAllocator<T> GetAllocator(bool zeroMem)

Gets allocator of unmanaged memory.