wip move to new uniffi language binding
This commit is contained in:
parent
f7a5d8f823
commit
53cbdd8440
30 changed files with 211 additions and 187 deletions
|
@ -2,13 +2,13 @@ using System.Buffers;
|
|||
|
||||
namespace TanksServer.Interactivity;
|
||||
|
||||
internal sealed class BufferPool: MemoryPool<byte>
|
||||
internal sealed class BufferPool : MemoryPool<byte>
|
||||
{
|
||||
private readonly MemoryPool<byte> _actualPool = Shared;
|
||||
|
||||
public override int MaxBufferSize => int.MaxValue;
|
||||
|
||||
protected override void Dispose(bool disposing) {}
|
||||
protected override void Dispose(bool disposing) { }
|
||||
|
||||
public override IMemoryOwner<byte> Rent(int minBufferSize = -1)
|
||||
{
|
||||
|
@ -16,7 +16,7 @@ internal sealed class BufferPool: MemoryPool<byte>
|
|||
return new BufferPoolMemoryOwner(_actualPool.Rent(minBufferSize), minBufferSize);
|
||||
}
|
||||
|
||||
private sealed class BufferPoolMemoryOwner(IMemoryOwner<byte> actualOwner, int wantedSize): IMemoryOwner<byte>
|
||||
private sealed class BufferPoolMemoryOwner(IMemoryOwner<byte> actualOwner, int wantedSize) : IMemoryOwner<byte>
|
||||
{
|
||||
public Memory<byte> Memory { get; } = actualOwner.Memory[..wantedSize];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue