48 __chunkSize(GUM_DEFAULT_CHUNK_SIZE),
49 __maxObjectSize(GUM_DEFAULT_MAX_OBJECT_SIZE) {
86 GUM_ASSERT(objectSize > 0);
92 #pragma omp critical(soa) 98 if (nb > UCHAR_MAX) nb = UCHAR_MAX;
99 unsigned char numBlocks =
static_cast< unsigned char >(nb);
118 const size_t& objectSize) {
120 GUM_ASSERT(objectSize > 0);
124 delete[](
unsigned char*) pDeallocatedObject;
128 #pragma omp critical(soa) 131 __pool[
Size(objectSize)]->deallocate(pDeallocatedObject);
iterator begin()
Returns an unsafe iterator pointing to the beginning of the hashtable.
const iterator & end() noexcept
Returns the unsafe iterator pointing to the end of the hashtable.
Headers of gum::SmallObjectAllocator.
Unsafe Iterators for hashtablesHashTableIterator provides a fast but unsafe way to parse HashTables...
bool exists(const Key &key) const
Checks whether there exists an element with a given key in the hashtable.
gum is the global namespace for all aGrUM entities
The class for generic Hash Tables.
virtual ~SmallObjectAllocator()
Destructor.
<agrum/core/smallObjectAllocator.h>
void set(const Key &key, const Val &default_value)
Add a new property or modify it if it already existed.
void deallocate(void *pDeallocatedObject, const size_t &objectSize)
Deallocates an object.
std::size_t __maxObjectSize
The maximal size of an object befor new is called.
Allocates objects of one given size.
void setKeyUniquenessPolicy(const bool new_policy) noexcept
Enables the user to change dynamically the policy for checking whether there can exist several elemen...
void * allocate(const size_t &objectSize)
Allocates a block.
static SmallObjectAllocator & instance()
std::size_t Size
In aGrUM, hashed values are unsigned long int.
std::size_t __chunkSize
The memory that a chunk allocates.
Headers of gum::FixedAllocator.
SmallObjectAllocator()
Constructor.