51 __chunkSize(GUM_DEFAULT_CHUNK_SIZE),
52 __maxObjectSize(GUM_DEFAULT_MAX_OBJECT_SIZE) {
89 GUM_ASSERT(objectSize > 0);
95 #pragma omp critical(soa) 101 if (nb > UCHAR_MAX) nb = UCHAR_MAX;
102 unsigned char numBlocks =
static_cast< unsigned char >(nb);
121 const size_t& objectSize) {
123 GUM_ASSERT(objectSize > 0);
127 delete[](
unsigned char*) pDeallocatedObject;
131 #pragma omp critical(soa) 134 __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.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
SmallObjectAllocator()
Constructor.