|
cds
2.3.2
|
Expandable bucket table. More...
#include <cds/intrusive/details/split_list_base.h>
Data Structures | |
| struct | aux_node_type |
| Auxiliary node type. More... | |
Public Types | |
| typedef GC | gc |
| Garbage collector. | |
| typedef Node | node_type |
| Bucket node type. | |
| typedef options::allocator | allocator |
| allocator | |
| typedef options::memory_model | memory_model |
| Memory model for atomic operations. | |
| typedef options::free_list | free_list |
| Free-list. | |
Public Member Functions | |
| expandable_bucket_table () | |
| Constructs bucket table for 512K buckets. Load factor is 1. | |
| expandable_bucket_table (size_t nItemCount, size_t nLoadFactor) | |
| Creates the table with specified capacity rounded up to nearest power-of-two. More... | |
| ~expandable_bucket_table () | |
| Destroys bucket table. | |
| aux_node_type * | bucket (size_t nBucket) const |
Returns head node of the bucket nBucket. | |
| void | bucket (size_t nBucket, aux_node_type *pNode) |
Set pNode as a head of bucket nBucket. | |
| aux_node_type * | alloc_aux_node () |
Allocates auxiliary node; can return nullptr if the table exhausted. | |
| void | free_aux_node (aux_node_type *p) |
| Places auxiliary node type to free-list. | |
| size_t | capacity () const |
| Returns the capacity of the bucket table. | |
| size_t | load_factor () const |
| Returns the load factor, i.e. average count of items per bucket. | |
Expandable bucket table.
This bucket table can dynamically grow its capacity when necessary up to maximum bucket count.
Template parameter:
GC - garbage collectorNode - node type, must be derived from split_list::node Options... - optionsOptions are:
opt::allocator - allocator used to allocate bucket table. Default is CDS_DEFAULT_ALLOCATORopt::memory_model - memory model used. Possible types are opt::v::sequential_consistent, opt::v::relaxed_ordering opt::free_list - free-list implementation; default is TaggedFreeList if the processor supports double-with CAS otherwise FreeList.
|
inline |
Creates the table with specified capacity rounded up to nearest power-of-two.
| nItemCount | Max expected item count in split-ordered list |
| nLoadFactor | Load factor |