|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
15 #ifndef included_clib_mhash_h
16 #define included_clib_mhash_h
61 #define MHASH_VEC_STRING_KEY 0
62 #define MHASH_C_STRING_KEY 1
98 key_tmp =
h->key_tmps[my_cpu];
113 return p ? &p->
value[0] : 0;
145 return h->n_key_bytes <= 1;
159 #define mhash_foreach(k,v,mh,body) \
161 hash_pair_t * _mhash_foreach_p; \
162 hash_foreach_pair (_mhash_foreach_p, (mh)->hash, ({ \
163 (k) = mhash_key_to_mem ((mh), _mhash_foreach_p->key); \
164 (v) = &_mhash_foreach_p->value[0]; \
format_function_t * format_key
format_function_t format_mhash_key
u32 * key_vector_free_indices
static void * mhash_key_to_mem(mhash_t *h, uword key)
static uword hash_elts(void *v)
static uword * mhash_get(mhash_t *h, const void *key)
static void mhash_init_c_string(mhash_t *h, uword n_value_bytes)
#define MHASH_VEC_STRING_KEY
#define MHASH_C_STRING_KEY
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static void mhash_init_vec_string(mhash_t *h, uword n_value_bytes)
static uword hash_value_bytes(hash_t *h)
static uword mhash_key_vector_is_heap(mhash_t *h)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
static uword mhash_value_bytes(mhash_t *m)
hash_pair_t * mhash_get_pair(mhash_t *h, const void *key)
static_always_inline uword os_get_thread_index(void)
void mhash_init(mhash_t *h, uword n_value_bytes, uword n_key_bytes)
static uword mhash_elts(mhash_t *m)
#define vec_free(V)
Free vector's memory (no header).
uword mhash_unset(mhash_t *h, void *key, uword *old_value)
static hash_t * hash_header(void *v)
static uword mhash_unset_key(mhash_t *h, uword key, uword *old_value)
static void mhash_free(mhash_t *h)
uword mhash_set_mem(mhash_t *h, void *key, uword *new_value, uword *old_value)
static uword mhash_set(mhash_t *h, void *key, uword new_value, uword *old_value)