[*] Bytebuffer move: missing flags

This commit is contained in:
Reece Wilson 2023-12-01 07:18:11 +00:00
parent cde973ba90
commit 503fd40032

View File

@ -206,6 +206,8 @@ namespace Aurora::Memory
this->flagCircular = other.flagCircular; this->flagCircular = other.flagCircular;
this->flagExpandable = other.flagExpandable; this->flagExpandable = other.flagExpandable;
this->flagAlwaysExpandable = other.flagAlwaysExpandable; this->flagAlwaysExpandable = other.flagAlwaysExpandable;
this->flagNoRealloc = other.flagNoRealloc;
this->flagNoFree = other.flagNoFree;
this->scaleSize = other.scaleSize; this->scaleSize = other.scaleSize;
other.base = {}; other.base = {};
other.length = {}; other.length = {};
@ -216,6 +218,8 @@ namespace Aurora::Memory
other.flagExpandable = {}; other.flagExpandable = {};
other.flagAlwaysExpandable = {}; other.flagAlwaysExpandable = {};
other.scaleSize = {}; other.scaleSize = {};
other.flagNoRealloc = {};
other.flagNoFree = {};
return *this; return *this;
} }
@ -229,21 +233,12 @@ namespace Aurora::Memory
} }
this->length = buffer.length; this->length = buffer.length;
this->allocSize = buffer.length; this->allocSize = buffer.length;
if (true) //preservePointers this->writePtr = this->base + (buffer.writePtr - buffer.base);
{ this->readPtr = this->base + (buffer.readPtr - buffer.base);
this->writePtr = this->base + (buffer.writePtr - buffer.base);
this->readPtr = this->base + (buffer.readPtr - buffer.base);
}
//else
//{
// this->writePtr = this->base;
// this->readPtr = this->base;
//}
AuMemcpy(this->base, buffer.base, this->length); AuMemcpy(this->base, buffer.base, this->length);
this->flagCircular = buffer.flagCircular; this->flagCircular = buffer.flagCircular;
this->flagExpandable = buffer.flagExpandable; this->flagExpandable = buffer.flagExpandable;
this->flagAlwaysExpandable = buffer.flagAlwaysExpandable; this->flagAlwaysExpandable = buffer.flagAlwaysExpandable;
this->scaleSize = buffer.scaleSize;
return *this; return *this;
} }