NahidaImpact/NahidaImpact.Kcp/DefaultArrayPoolBufferAllocator.cs
2024-01-04 16:48:39 +03:00

13 lines
395 B
C#

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);
}
}
}