74 _pool_.setKeyUniquenessPolicy(
false);
110 GUM_ASSERT(objectSize > 0);
113 if (objectSize >
_maxObjectSize_)
return new unsigned char[objectSize];
116#pragma omp critical(soa)
122 if (nb > UCHAR_MAX) nb = UCHAR_MAX;
123 unsigned char numBlocks =
static_cast< unsigned char >(nb);
143 GUM_ASSERT(objectSize > 0);
147 delete[] (
unsigned char*)pDeallocatedObject;
151#pragma omp critical(soa)
154 _pool_[
Size(objectSize)]->deallocate(pDeallocatedObject);
Allocates objects of one given size.
The class for generic Hash Tables.
HashTableIterator< Size, FixedAllocator * > iterator
static SmallObjectAllocator & instance()
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.
Headers of gum::FixedAllocator.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
gum is the global namespace for all aGrUM entities
Headers of gum::SmallObjectAllocator.