parent
c3a986495c
commit
e0d672ae9b
@ -281,15 +281,8 @@ namespace Aurora::Memory
|
||||
this->flagReadError = 0;
|
||||
this->flagWriteError = 0;
|
||||
this->readPtr = base;
|
||||
if (this->flagCircular)
|
||||
{
|
||||
this->writePtr = base;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->writePtr = this->base + length;
|
||||
}
|
||||
}
|
||||
|
||||
// utils: Iterator
|
||||
|
||||
@ -395,6 +388,7 @@ namespace Aurora::Memory
|
||||
|
||||
inline auline bool Allocate(AuUInt length, bool fast = true);
|
||||
inline auline bool Allocate(AuUInt length, AuUInt alignment, bool fast = true);
|
||||
inline auline bool SetBuffer(MemoryViewRead readView);
|
||||
inline auline bool SetBuffer(const void *in, AuUInt length);
|
||||
inline auline bool SetBuffer(const AuList<AuUInt8> &buffer);
|
||||
|
||||
|
@ -68,6 +68,22 @@ namespace Aurora::Memory
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ByteBuffer::SetBuffer(MemoryViewRead readView)
|
||||
{
|
||||
if (!Allocate(readView.length))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this->length)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
AuMemcpy(this->base, readView.ptr, this->length);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ByteBuffer::SetBuffer(const void *in, AuUInt length)
|
||||
{
|
||||
if (!Allocate(length))
|
||||
|
Loading…
Reference in New Issue
Block a user