Skip to content

Commit

Permalink
Fixed bug in allocation of buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
Drawaes committed Apr 23, 2017
1 parent 19197a4 commit 761f685
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Leto.EphemeralBuffers/EphemeralBufferPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ public override OwnedBuffer<byte> Rent(int minimumBufferSize)
}
lock (_buffers)
{
if (_currentAllocatedOffset >= (_totalAllocated - _bufferSize))
if (_currentAllocatedOffset >= _totalAllocated)
{
ExceptionHelper.OutOfAvailableBuffers();
}
_currentAllocatedOffset += _bufferSize;
var buffer = new EphemeralOwnedBuffer(_currentAllocatedOffset, _bufferSize, this);
_currentAllocatedOffset += _bufferSize;
return buffer;
}
}
Expand Down

0 comments on commit 761f685

Please sign in to comment.