16 #error do not #include this file! 128 clib_bihash_kv * search_v, clib_bihash_kv * return_v);
141 void *callback,
void *arg);
u8 pad[3]
log2 (size of the packing page block)
#define BIHASH_KVP_PER_PAGE
void clib_bihash_free(clib_bihash *h)
Destroy a bounded index extensible hash table.
clib_bihash_bucket_t saved_bucket
Saved bucket pointer.
clib_bihash_bucket_t * buckets
Hash bucket vector, power-of-two in size.
int clib_bihash_add_del(clib_bihash *h, clib_bihash_kv *add_v, int is_add)
Add or delete a (key,value) pair from a bi-hash table.
clib_bihash_kv kvp[BIHASH_KVP_PER_PAGE]
the actual key/value pairs
static uword clib_bihash_get_offset(clib_bihash *h, void *v)
Get clib mheap offset given a pointer.
u32 log2_nbuckets
lg(nbuckets)
void clib_bihash_init(clib_bihash *h, char *name, u32 nbuckets, uword memory_size)
initialize a bounded index extensible hash table
void clib_bihash_foreach_key_value_pair(clib_bihash *h, void *callback, void *arg)
Visit active (key,value) pairs in a bi-hash table.
A bounded index extensible hash table.
void * mheap
clib memory heap
int clib_bihash_search(clib_bihash *h, clib_bihash_kv *search_v, clib_bihash_kv *return_v)
Search a bi-hash table.
clib_bihash_value * next_free
used when a KVP page (or block thereof) is on a freelist
template key/value backing page structure
u32 nbuckets
Number of hash buckets.
volatile u32 * writer_lock
Writer lock, in its own cache line.
struct clib_bihash_value offset
template key/value backing page structure
static void * clib_bihash_get_value(clib_bihash *h, uword offset)
Get pointer to value page given its clib mheap offset.