50#ifndef GUM_SMALL_OBJECT_ALLOCATOR_H
51#define GUM_SMALL_OBJECT_ALLOCATOR_H
134 void*
allocate(
const size_t& objectSize);
142 void deallocate(
void* pDeallocatedObject,
const size_t& objectSize);
182#define SOA_ALLOCATE(x) SmallObjectAllocator::instance().allocate(x)
183#define SOA_DEALLOCATE(x, y) SmallObjectAllocator::instance().deallocate(x, y)
The class for generic Hash Tables.
<agrum/base/core/smallObjectAllocator.h>
HashTable< Size, FixedAllocator * > _Pool_
The pool containing FixedAllocator.
static SmallObjectAllocator & instance()
SmallObjectAllocator & operator=(const SmallObjectAllocator &)
Operator = (does nothing since we use a Singleton).
void displayStats()
Displays the number of allocation and deallocation made so far.
void * allocate(const size_t &objectSize)
Allocates a block.
static const size_t GUM_DEFAULT_CHUNK_SIZE
SmallObjectAllocator()
Constructor.
void deallocate(void *pDeallocatedObject, const size_t &objectSize)
Deallocates an object.
static const size_t GUM_DEFAULT_MAX_OBJECT_SIZE
std::size_t _maxObjectSize_
The maximal size of an object befor new is called.
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).
Headers of gum::FixedAllocator.
Size Idx
Type for indexes.
Class hash tables iterators.
gum is the global namespace for all aGrUM entities
Inlines of gum::SmallObjectAllocator.