30 #ifndef GUM_SMALL_OBJECT_ALLOCATOR_H 31 #define GUM_SMALL_OBJECT_ALLOCATOR_H 34 #include <agrum/agrum.h> 36 #include <agrum/tools/core/hashTable.h> 37 #include <agrum/tools/core/smallobjectallocator/fixedAllocator.h> 114 void*
allocate(
const size_t& objectSize);
122 void deallocate(
void* pDeallocatedObject,
const size_t& objectSize);
130 GUM_TRACE(
"Nb Small Allocation : " << nbAllocation
131 <<
" - Nb Small Deallocation : " 161 #define SOA_ALLOCATE(x) SmallObjectAllocator::instance().allocate(x) 162 #define SOA_DEALLOCATE(x, y) SmallObjectAllocator::instance().deallocate(x, y) 164 #ifndef GUM_NO_INLINE 165 # include <agrum/tools/core/smallobjectallocator/smallObjectAllocator_inl.h> HashTable< Size, FixedAllocator *> Pool__
The pool containing FixedAllocator.
SmallObjectAllocator & operator=(const SmallObjectAllocator &)
Operator = (does nothing since we use a Singleton)
static const size_t GUM_DEFAULT_MAX_OBJECT_SIZE
INLINE void emplace(Args &&... args)
static const size_t GUM_DEFAULT_CHUNK_SIZE
virtual ~SmallObjectAllocator()
Destructor.
std::size_t chunkSize__
The memory that a chunk allocates.
SmallObjectAllocator(const SmallObjectAllocator &)
Copy Constructor (does nothing since we use a Singleton)
<agrum/tools/core/smallObjectAllocator.h>
std::size_t maxObjectSize__
The maximal size of an object befor new is called.
void displayStats()
Displays the number of allocation and deallocation made so far.
void deallocate(void *pDeallocatedObject, const size_t &objectSize)
Deallocates an object.
void * allocate(const size_t &objectSize)
Allocates a block.
static SmallObjectAllocator & instance()
SmallObjectAllocator()
Constructor.