ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::containers::detail Namespace Reference

Description:

Detail namespace of module ALib Containers.

Type Index:

struct  HashTableBase
 
struct  HTElementCached
 
struct  HTElementSelector
 
struct  HTElementUncached
 
struct  ListElement
 Extents BidiNodeBase by an value of type T. More...
 
struct  RecyclerPrivate
 
class  RecyclerShared
 
struct  RecyclerVoid
 
struct  RecyclingSelector
 
class  SharedRecycler
 
struct  StringTreeBase
 

Function Index:

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 *, integerdisposeListImpl (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 *, integerrecycleListImpl (lang::SidiListHook< TNode > &recyclables, TNode *begin, TNode *end)
 
template<typename TAllocator, typename TNode>
void reserveImpl (TAllocator &allocator, lang::SidiListHook< TNode > &recyclables, integer qty)
 

Variable Index:

ALIB_DLL void * DUMMY_BUCKET
 A dummy bucket used for nulled hash tables to avoid otherwise necessary checks.
 
ALIB_DLL const uinteger PRIME_NUMBERS [PRIME_TABLE_SIZE]
 

Function Details:

◆ disposeImpl()

template<typename TAllocator, typename TNode>
void alib::containers::detail::disposeImpl ( TAllocator & allocator,
TNode * elem )

Frees an element (no recycling).

Parameters
allocatorThe allocator to use.
elemThe element to recycle.

Definition at line 137 of file recycling.inl.

Here is the call graph for this function:

◆ 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
allocatorThe allocator to use.
beginThe first element of the list to free.

Definition at line 149 of file recycling.inl.

Here is the call graph for this function:

◆ 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
allocatorThe allocator to use.
beginThe first element of the list to free.
endThe 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.

Here is the call graph for this function:

◆ 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
TChunkThe type of the external chunk.
Parameters
recyclablesThe recycling stack.
chunkThe recyclable chunk's address.
countThe number of objects. (For non-array types, 1 is to be given.)

Definition at line 196 of file recycling.inl.

Here is the call graph for this function:

◆ recycleImpl()

template<typename TNode>
void alib::containers::detail::recycleImpl ( lang::SidiListHook< TNode > & recyclables,
TNode * elem )

Stores an element for recycling.

Parameters
recyclablesThe recycling stack.
elemThe element to recycle.

Definition at line 46 of file recycling.inl.

Here is the call graph for this function:

◆ 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
recyclablesThe recycling stack.
beginThe first element of the list store, must not be nullptr.

Definition at line 57 of file recycling.inl.

Here is the call graph for this function:

◆ 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
recyclablesThe recycling stack.
beginThe first element of the list store.
endThe 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.

Here is the call graph for this function:

◆ 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
allocatorThe allocator to use.
recyclablesThe recycling stack.
qtyThe quantity of elements to reserve.

Definition at line 107 of file recycling.inl.

Here is the call graph for this function:

Variable Details:

◆ PRIME_NUMBERS

ALIB_DLL const uinteger alib::containers::detail::PRIME_NUMBERS[PRIME_TABLE_SIZE]
extern

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.