mirror of
https://github.com/decaf-emu/decaf-emu.git
synced 2026-10-11 08:08:15 +00:00
common: Add FrameAllocator default constructor.
Also bool empty() and reset().
This commit is contained in:
@@ -6,6 +6,13 @@
|
||||
class FrameAllocator
|
||||
{
|
||||
public:
|
||||
FrameAllocator() :
|
||||
mBase(nullptr),
|
||||
mSize(0),
|
||||
mOffset(0)
|
||||
{
|
||||
}
|
||||
|
||||
FrameAllocator(void *base, size_t size) :
|
||||
mBase(reinterpret_cast<uint8_t *>(base)),
|
||||
mSize(size),
|
||||
@@ -13,6 +20,12 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
empty() const
|
||||
{
|
||||
return mOffset == 0;
|
||||
}
|
||||
|
||||
uint8_t *
|
||||
top() const
|
||||
{
|
||||
@@ -36,6 +49,12 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
reset()
|
||||
{
|
||||
mOffset = 0;
|
||||
}
|
||||
|
||||
protected:
|
||||
uint8_t *mBase;
|
||||
size_t mSize;
|
||||
|
||||
Reference in New Issue
Block a user