1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00
Beef/BeefySysLib/util/Heap.h

33 lines
417 B
C
Raw Normal View History

2020-12-17 04:51:05 -08:00
#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);
2021-11-26 17:59:58 -08:00
void Validate();
2020-12-17 04:51:05 -08:00
void DebugDump();
};
NS_BF_END