Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Header file for Fixed Size Allocator
#include "BitArray.h"
namespace Engine
class FixedSizeAllocator
FixedSizeAllocator(const size_t size, const size_t numBlocks, BlockAllocator* blockAllocator);
void destroy();
void* allocate(size_t size);
void free(void* pointer);
bool isInRange(void* pointer, const void* left, const void* right);
size_t getBlockIndex(void* pointer);
size_t getBlockSize() const;
size_t getBlockNumber() const;
void* getBlockStart() const;
void* getBlockOver() const;
BitArray* getBitArray();
BitArray* bitArray;
size_t blockSize;
size_t numBlock;
static BlockAllocator* allocator;
void* blockStart;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment