Detail namespace of module ALib Containers.
|
template<typename TAllocator , typename TNode > |
void | disposeImpl (TAllocator &allocator, TNode *elem) |
|
template<typename TAllocator , typename TNode > |
void | disposeListImpl (TAllocator &allocator, TNode *begin) |
|
template<typename TAllocator , typename TNode > |
std::pair< TNode *, integer > | disposeListImpl (TAllocator &allocator, TNode *begin, TNode *end) |
|
template<typename TNode , typename TChunk > |
void | recycleChunkImpl (lang::SidiListHook< TNode > &recyclables, TChunk *chunk, size_t count) |
|
template<typename TNode > |
void | recycleImpl (lang::SidiListHook< TNode > &recyclables, TNode *elem) |
|
template<typename TNode > |
void | recycleListImpl (lang::SidiListHook< TNode > &recyclables, TNode *begin) |
|
template<typename TNode > |
std::pair< TNode *, integer > | recycleListImpl (lang::SidiListHook< TNode > &recyclables, TNode *begin, TNode *end) |
|
template<typename TAllocator , typename TNode > |
void | reserveImpl (TAllocator &allocator, lang::SidiListHook< TNode > &recyclables, integer qty) |
|
◆ disposeImpl()
template<typename TAllocator , typename TNode >
void disposeImpl |
( |
TAllocator & | allocator, |
|
|
TNode * | elem ) |
Frees an element (no recycling).
- Parameters
-
allocator | The allocator to use. |
elem | The element to recycle. |
Definition at line 124 of file recycler.hpp.
◆ disposeListImpl() [1/2]
template<typename TAllocator , typename TNode >
void disposeListImpl |
( |
TAllocator & | allocator, |
|
|
TNode * | begin ) |
Deletes the given list. This shared recycler does not free the node, but recycles them.
- Parameters
-
allocator | The allocator to use. |
begin | The first element of the list to free. |
Definition at line 136 of file recycler.hpp.
◆ disposeListImpl() [2/2]
template<typename TAllocator , typename TNode >
std::pair< TNode *, integer > disposeListImpl |
( |
TAllocator & | allocator, |
|
|
TNode * | begin, |
|
|
TNode * | end ) |
Deletes a list of elements for recycling. Both given nodes have to exist.
- Parameters
-
allocator | The allocator to use. |
begin | The first element of the list to free. |
end | The first element not to be freed. |
- Returns
- A pair of values. The first is a pointer to the last node deleted, and the second provides the number of nodes deleted.
Definition at line 157 of file recycler.hpp.
◆ recycleChunkImpl()
template<typename TNode , typename TChunk >
void recycleChunkImpl |
( |
lang::SidiListHook< TNode > & | recyclables, |
|
|
TChunk * | chunk, |
|
|
size_t | count ) |
Recycles a chunk of memory that is not of the node type. Such recycling is useful for example, in combination with hash tables, which usually allocate a "bucket array" that grows over time. In this case, the former smaller bucket array may be passed to this method to recycle it as future node elements.
- Template Parameters
-
TChunk | The type of the external chunk. |
- Parameters
-
recyclables | The recycling stack. |
chunk | The recyclable chunk's address. |
count | The number of objects. (For non-array types, 1 is to be given.) |
Definition at line 183 of file recycler.hpp.
◆ recycleImpl()
template<typename TNode >
Stores an element for recycling.
- Parameters
-
recyclables | The recycling stack. |
elem | The element to recycle. |
Definition at line 31 of file recycler.hpp.
◆ recycleListImpl() [1/2]
template<typename TNode >
Stores a list of elements for recycling (from the begin element to the last one).
- Parameters
-
recyclables | The recycling stack. |
begin | The first element of the list store, must not be nullptr . |
Definition at line 42 of file recycler.hpp.
◆ recycleListImpl() [2/2]
template<typename TNode >
Stores a list of elements for recycling. Both given nodes have to exist.
- Parameters
-
recyclables | The recycling stack. |
begin | The first element of the list store. |
end | The first element not to be recycled. |
- Returns
- A pair of values. The first is a pointer to the last node recycled, and the second provides the number of nodes recycled.
Definition at line 64 of file recycler.hpp.
◆ reserveImpl()
template<typename TAllocator , typename TNode >
Reserves the given qty of recyclables. If the allocator used returns true
with method allowsMemSplit (like like MonoAllocator does), then one chunk is allocated and cut into pieces.
Otherwise, common allocations are performed
- Parameters
-
allocator | The allocator to use. |
recyclables | The recycling stack. |
qty | The quantity of elements to reserve. |
Definition at line 92 of file recycler.hpp.
◆ PRIME_NUMBERS
Table of prime numbers. The effective bucket size is chosen to be the first value found in this table that is equal or higher than the requested size.
◆ PRIME_TABLE_SIZE
int PRIME_TABLE_SIZE = 58 |
|
staticconstexpr |
The size of the static table of prime numbers. Depends on the platform.
Definition at line 37 of file hashtablebase.inl.