Skip to content
Snippets Groups Projects
Commit f722d485 authored by j2-mcdaid's avatar j2-mcdaid :skull_crossbones:
Browse files

Upload New File

parent 3a1e3efb
No related branches found
No related tags found
No related merge requests found
#ifndef ALLOCATOR_HPP
#define ALLOCATOR_HPP
#include <cstddef> // gives size_t for representing size in bytes
class bAllocator{ // originally allocator but causes confusion
private: // define pointers and allocate variables
void* heap_start;
void* next;
size_t heap_size;
size_t a_count;
public:
// constructor for fixed heap size using template
explicit bAllocator(size_t size);
// declare destructor for cpp implementation
~bAllocator();
// Allocates memory for count objects using template
template <typename T>
T* alloc(size_t count);
// declare deallocator for cpp implementation
void dealloc();
};
#include "allocator.tpp"
#endif
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment