mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
32 lines
399 B
C
32 lines
399 B
C
![]() |
#pragma once
|
||
|
|
||
|
#include "../Common.h"
|
||
|
|
||
|
NS_BF_BEGIN
|
||
|
|
||
|
class ContiguousHeap
|
||
|
{
|
||
|
public:
|
||
|
typedef int AllocRef;
|
||
|
|
||
|
public:
|
||
|
void* mMetadata;
|
||
|
|
||
|
int mMemorySize;
|
||
|
int mBlockDataOfs;
|
||
|
Array<AllocRef> mFreeList;
|
||
|
int mFreeIdx;
|
||
|
|
||
|
public:
|
||
|
ContiguousHeap();
|
||
|
virtual ~ContiguousHeap();
|
||
|
|
||
|
void Clear(int maxAllocSize = -1);
|
||
|
|
||
|
AllocRef Alloc(int size);
|
||
|
bool Free(AllocRef ref);
|
||
|
|
||
|
void DebugDump();
|
||
|
};
|
||
|
|
||
|
NS_BF_END
|