mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
33 lines
No EOL
417 B
C++
33 lines
No EOL
417 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 Validate();
|
|
void DebugDump();
|
|
};
|
|
|
|
NS_BF_END |