File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ private ref readonly MemoryOwner<byte> EnsureBufferAllocated()
103103 {
104104 ref var result = ref buffer ;
105105 if ( result . IsEmpty )
106- result = Allocator . AllocateAtLeast ( maxBufferSize ) ;
106+ result = Allocator . AllocateExactly ( maxBufferSize ) ;
107107
108108 Debug . Assert ( ! result . IsEmpty ) ;
109109 return ref result ;
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ private ref readonly MemoryOwner<byte> EnsureBufferAllocated()
7171 {
7272 ref var result = ref buffer ;
7373 if ( result . IsEmpty )
74- result = Allocator . AllocateAtLeast ( maxBufferSize ) ;
74+ result = Allocator . AllocateExactly ( maxBufferSize ) ;
7575
7676 Debug . Assert ( ! result . IsEmpty ) ;
7777 return ref result ;
@@ -108,7 +108,7 @@ public void Produce(int count)
108108 ArgumentOutOfRangeException . ThrowIfGreaterThan ( ( uint ) count , ( uint ) FreeCapacity , nameof ( count ) ) ;
109109
110110 if ( count > 0 && buffer . IsEmpty )
111- buffer = Allocator . AllocateAtLeast ( maxBufferSize ) ;
111+ buffer = Allocator . AllocateExactly ( maxBufferSize ) ;
112112
113113 bufferOffset += count ;
114114 }
You can’t perform that action at this time.
0 commit comments