WutheringWaves/KcpSharp/DefaultArrayPoolBufferAllocator.cs

14 lines
387 B
C#
Raw Permalink Normal View History

2024-02-07 21:41:39 +00:00
namespace KcpSharp
{
internal sealed class DefaultArrayPoolBufferAllocator : IKcpBufferPool
{
public static DefaultArrayPoolBufferAllocator Default { get; } = new DefaultArrayPoolBufferAllocator();
public KcpRentedBuffer Rent(KcpBufferPoolRentOptions options)
{
return KcpRentedBuffer.FromSharedArrayPool(options.Size);
}
}
}