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 alib::containers::detail::disposeImpl |
( |
TAllocator & | allocator, |
|
|
TNode * | elem ) |
Frees an element (no recycling).
- Parameters
-
allocator | The allocator to use. |
elem | The element to recycle. |
Definition at line 137 of file recycling.inl.
◆ disposeListImpl() [1/2]
template<typename TAllocator, typename TNode>
void alib::containers::detail::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 149 of file recycling.inl.
◆ disposeListImpl() [2/2]
template<typename TAllocator, typename TNode>
std::pair< TNode *, integer > alib::containers::detail::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 170 of file recycling.inl.
◆ recycleChunkImpl()
template<typename TNode, typename TChunk>
void alib::containers::detail::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 196 of file recycling.inl.
◆ recycleImpl()
template<typename TNode>
void alib::containers::detail::recycleImpl |
( |
lang::SidiListHook< TNode > & | recyclables, |
|
|
TNode * | elem ) |
Stores an element for recycling.
- Parameters
-
recyclables | The recycling stack. |
elem | The element to recycle. |
Definition at line 46 of file recycling.inl.
◆ recycleListImpl() [1/2]
template<typename TNode>
void alib::containers::detail::recycleListImpl |
( |
lang::SidiListHook< TNode > & | recyclables, |
|
|
TNode * | begin ) |
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 57 of file recycling.inl.
◆ recycleListImpl() [2/2]
template<typename TNode>
std::pair< TNode *, integer > alib::containers::detail::recycleListImpl |
( |
lang::SidiListHook< TNode > & | recyclables, |
|
|
TNode * | begin, |
|
|
TNode * | end ) |
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 79 of file recycling.inl.
◆ reserveImpl()
template<typename TAllocator, typename TNode>
void alib::containers::detail::reserveImpl |
( |
TAllocator & | allocator, |
|
|
lang::SidiListHook< TNode > & | recyclables, |
|
|
integer | qty ) |
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 107 of file recycling.inl.
◆ 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.