ALib C++ Library
Library Version: 2412 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_API void * DUMMY_BUCKET
 A dummy bucket used for nulled hash tables to avoid otherwise necessary checks.
 
ALIB_API const uinteger PRIME_NUMBERS [PRIME_TABLE_SIZE]
 
static constexpr int PRIME_TABLE_SIZE = 58
 The size of the static table of prime numbers. Depends on the platform.
 

Function Details:

◆ disposeImpl()

template<typename TAllocator , typename TNode >
void disposeImpl ( TAllocator & allocator,
TNode * elem )

Frees an element (no recycling).

Parameters
allocatorThe allocator to use.
elemThe element to recycle.

Definition at line 124 of file recycler.hpp.

Here is the call graph for this function:

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

Definition at line 136 of file recycler.hpp.

Here is the call graph for this function:

◆ 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
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 157 of file recycler.hpp.

Here is the call graph for this function:

◆ 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
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 183 of file recycler.hpp.

Here is the call graph for this function:

◆ recycleImpl()

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

Stores an element for recycling.

Parameters
recyclablesThe recycling stack.
elemThe element to recycle.

Definition at line 31 of file recycler.hpp.

Here is the call graph for this function:

◆ recycleListImpl() [1/2]

template<typename TNode >
void 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 42 of file recycler.hpp.

Here is the call graph for this function:

◆ recycleListImpl() [2/2]

template<typename TNode >
std::pair< TNode *, integer > 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 64 of file recycler.hpp.

Here is the call graph for this function:

◆ reserveImpl()

template<typename TAllocator , typename TNode >
void 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 92 of file recycler.hpp.

Here is the call graph for this function:

Variable Details:

◆ PRIME_NUMBERS

ALIB_API const uinteger 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.

◆ 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.