Crater Container Library 0.2.0
|
|
A hash table. More...
#include <hash.h>
Data Fields | |
void * | table_a |
Buffer for the main internal table. | |
void * | table_b |
Buffer for the second internal table if present. | |
uint64_t * | flags_a |
Metadata about which entries are present/deleted/absent in the main table. More... | |
uint64_t * | flags_b |
Metadata about which entries are present/deleted/absent in the second table. | |
uint64_t | cap |
Total number of elements that can be stored before expanding the table. More... | |
uint64_t | len_a |
Length of buffer for main internal table (in elements not bytes). | |
uint64_t | len_b |
Length of buffer for second internal table (in elements not bytes). | |
uint64_t | i |
Current index for incremental rehashing. | |
uint64_t | r |
Amount of entries that are rehashed at once. More... | |
uint64_t | full |
Total number of elements currently in the table. | |
A hash table.
Fields of this struct should not be edited directly, only through the functions in this file.
uint64_t* cr8r_hashtbl_t::flags_a |
uint64_t cr8r_hashtbl_t::cap |
Total number of elements that can be stored before expanding the table.
Recomputed only when the table actually expands. In particular, inserting multiple elements with different load factors in the function table will not cause a re-hash (cr8r_hashtbl_ft::load_factor, cr8r_hash_insert).
uint64_t cr8r_hashtbl_t::r |
Amount of entries that are rehashed at once.
Like cr8r_hashtbl_t::cap, this is only updated when the table expands (or incrementally moving entries from the old table to the new table finishes).