1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-04 23:36:00 +02:00

CTFE updates, including heap support

This commit is contained in:
Brian Fiete 2020-12-17 04:51:05 -08:00
parent 792d92d014
commit 6bb363fb4b
29 changed files with 3050 additions and 595 deletions

32
BeefySysLib/util/Heap.h Normal file
View file

@ -0,0 +1,32 @@
#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