NahidaImpact/NahidaImpact.Kcp/DefaultArrayPoolBufferAllocator.cs

14 lines
395 B
C#
Raw Normal View History

2024-01-04 13:48:39 +00:00
namespace NahidaImpact.Kcp
{
internal sealed class DefaultArrayPoolBufferAllocator : IKcpBufferPool
{
public static DefaultArrayPoolBufferAllocator Default { get; } = new DefaultArrayPoolBufferAllocator();
public KcpRentedBuffer Rent(KcpBufferPoolRentOptions options)
{
return KcpRentedBuffer.FromSharedArrayPool(options.Size);
}
}
}