27 #ifndef MAT_ALLOCATOR_HEADER
28 #define MAT_ALLOCATOR_HEADER
59 throw std::runtime_error(
"Error in Allocator::alloc(): no free slots.");
69 throw std::runtime_error(
"Error in Allocator::free(): unknown ptr.");
71 if((count % noOfRealsPerBuffer) != 0)
72 throw std::runtime_error(
"Error in Allocator::free(): bad ptr.");
75 throw std::runtime_error(
"Error in Allocator::free(): -1 not found.");
Treal * alloc()
Definition: Allocator.h:57
int noOfOccupiedSlots
Definition: Allocator.h:104
int noOfRealsPerBuffer
Definition: Allocator.h:99
int * nextFreeIndexList
Definition: Allocator.h:102
Definition: allocate.cc:30
bool isFull()
Definition: Allocator.h:80
void free(Treal *ptr)
Definition: Allocator.h:67
int noOfBuffers
Definition: Allocator.h:100
int firstFreeIndex
Definition: Allocator.h:103
bool ownsPtr(Treal *ptr)
Definition: Allocator.h:90
Treal * buffer
Definition: Allocator.h:101
bool isEmpty()
Definition: Allocator.h:85
~Allocator()
Definition: Allocator.h:52
Definition: Allocator.h:35
Allocator(int noOfRealsPerBuffer_, int noOfBuffers_)
Definition: Allocator.h:38
int getNoOfOccupiedSlots()
Definition: Allocator.h:95