diff --git a/Include/Aurora/Memory/ByteBuffer.hpp b/Include/Aurora/Memory/ByteBuffer.hpp index 40427a49..ee3f25cb 100644 --- a/Include/Aurora/Memory/ByteBuffer.hpp +++ b/Include/Aurora/Memory/ByteBuffer.hpp @@ -97,6 +97,7 @@ namespace Aurora::Memory this->scaleSize = buffer.scaleSize; this->flagReadError = buffer.flagReadError; this->flagWriteError = buffer.flagWriteError; + this->alignment = buffer.alignment; buffer.base = {}; buffer.length = {}; buffer.allocSize = {}; @@ -106,6 +107,7 @@ namespace Aurora::Memory buffer.flagExpandable = {}; buffer.flagAlwaysExpandable = {}; buffer.scaleSize = {}; + buffer.alignment = {}; } /** @@ -117,7 +119,14 @@ namespace Aurora::Memory { if (buffer.length) { - this->base = ZAlloc(buffer.length); + if (buffer.alignment) + { + this->base = ZAlloc(buffer.length, buffer.alignment); + } + else + { + this->base = ZAlloc(buffer.length); + } } this->scaleSize = buffer.scaleSize; this->flagCircular = buffer.flagCircular; @@ -216,6 +225,7 @@ namespace Aurora::Memory } this->scaleSize = kBufferInitialPower; this->base = ZAlloc(length, alignment); + this->alignment = alignment; if (!this->base) { Reset();