WutheringWaves/KcpSharp/DefaultArrayPoolBufferAllocator.cs
2024-02-08 00:41:39 +03:00

13 lines
387 B
C#

namespace KcpSharp
{
internal sealed class DefaultArrayPoolBufferAllocator : IKcpBufferPool
{
public static DefaultArrayPoolBufferAllocator Default { get; } = new DefaultArrayPoolBufferAllocator();
public KcpRentedBuffer Rent(KcpBufferPoolRentOptions options)
{
return KcpRentedBuffer.FromSharedArrayPool(options.Size);
}
}
}