43 #ifndef MAT_ALLOCATOR_HEADER 44 #define MAT_ALLOCATOR_HEADER 75 throw std::runtime_error(
"Error in Allocator::alloc(): no free slots.");
85 throw std::runtime_error(
"Error in Allocator::free(): unknown ptr.");
88 throw std::runtime_error(
"Error in Allocator::free(): bad ptr.");
91 throw std::runtime_error(
"Error in Allocator::free(): -1 not found.");
Treal * alloc()
Definition: Allocator.h:73
int noOfOccupiedSlots
Definition: Allocator.h:120
int noOfRealsPerBuffer
Definition: Allocator.h:115
int * nextFreeIndexList
Definition: Allocator.h:118
Definition: allocate.cc:39
bool isFull()
Definition: Allocator.h:96
void free(Treal *ptr)
Definition: Allocator.h:83
int noOfBuffers
Definition: Allocator.h:116
int firstFreeIndex
Definition: Allocator.h:119
bool ownsPtr(Treal *ptr)
Definition: Allocator.h:106
Treal * buffer
Definition: Allocator.h:117
bool isEmpty()
Definition: Allocator.h:101
~Allocator()
Definition: Allocator.h:68
Definition: Allocator.h:51
Allocator(int noOfRealsPerBuffer_, int noOfBuffers_)
Definition: Allocator.h:54
int getNoOfOccupiedSlots()
Definition: Allocator.h:111