FurinaImpact/FurinaImpact.Kcp/DefaultArrayPoolBufferAllocator.cs

14 lines
395 B
C#
Raw Normal View History

2023-12-09 03:45:08 +00:00
namespace FurinaImpact.Kcp
{
internal sealed class DefaultArrayPoolBufferAllocator : IKcpBufferPool
{
public static DefaultArrayPoolBufferAllocator Default { get; } = new DefaultArrayPoolBufferAllocator();
public KcpRentedBuffer Rent(KcpBufferPoolRentOptions options)
{
return KcpRentedBuffer.FromSharedArrayPool(options.Size);
}
}
}