[*] clamp head positions during non-circular realloc
This commit is contained in:
parent
6683d3cfdc
commit
cc317882e9
@ -177,6 +177,13 @@ namespace Aurora::Memory
|
||||
|
||||
oldWriteIdx = this->writePtr - this->base;
|
||||
oldReadIdx = this->readPtr - this->base;
|
||||
|
||||
if (!flagCircular)
|
||||
{
|
||||
oldWriteIdx = AuMin<AuUInt>(length, oldWriteIdx);
|
||||
oldReadIdx = AuMin<AuUInt>(length, oldReadIdx);
|
||||
}
|
||||
|
||||
nextRead = nextPtr + oldReadIdx;
|
||||
nextWrite = nextPtr + oldWriteIdx;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user