Go to the documentation of this file.
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.");
void free(Treal *ptr)
Definition: Allocator.h:83
bool ownsPtr(Treal *ptr)
Definition: Allocator.h:106
bool isFull()
Definition: Allocator.h:96
int getNoOfOccupiedSlots()
Definition: Allocator.h:111
int noOfBuffers
Definition: Allocator.h:116
Treal * buffer
Definition: Allocator.h:117
Definition: Allocator.h:52
int firstFreeIndex
Definition: Allocator.h:119
Allocator(int noOfRealsPerBuffer_, int noOfBuffers_)
Definition: Allocator.h:54
int noOfOccupiedSlots
Definition: Allocator.h:120
Definition: allocate.cc:39
int * nextFreeIndexList
Definition: Allocator.h:118
~Allocator()
Definition: Allocator.h:68
Treal * alloc()
Definition: Allocator.h:73
bool isEmpty()
Definition: Allocator.h:101
int noOfRealsPerBuffer
Definition: Allocator.h:115