|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
15 #ifndef included_clib_fheap_h
16 #define included_clib_fheap_h
47 #define foreach_fheap_node_sibling(f,ni,first_ni,body) \
49 u32 __fheap_foreach_first_ni = (first_ni); \
50 u32 __fheap_foreach_ni = __fheap_foreach_first_ni; \
51 u32 __fheap_foreach_next_ni; \
52 fheap_node_t * __fheap_foreach_n; \
53 if (__fheap_foreach_ni != ~0) \
56 __fheap_foreach_n = fheap_get_node ((f), __fheap_foreach_ni); \
57 __fheap_foreach_next_ni = __fheap_foreach_n -> next_sibling; \
58 (ni) = __fheap_foreach_ni; \
63 if (__fheap_foreach_next_ni == __fheap_foreach_first_ni) \
66 __fheap_foreach_ni = __fheap_foreach_next_ni; \
90 u32 *save_root_list =
f->root_list_by_rank;
94 f->nodes = save_nodes;
95 f->root_list_by_rank = save_root_list;
119 return f->min_root == ~0;
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
void fheap_del(fheap_t *f, u32 ni)
u32 fheap_del_min(fheap_t *f, u32 *min_key)
void fheap_decrease_key(fheap_t *f, u32 ni, u32 new_key)
static void fheap_init(fheap_t *f, u32 n_nodes)
void fheap_add(fheap_t *f, u32 ni, u32 key)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
#define vec_free(V)
Free vector's memory (no header).
static void fheap_free(fheap_t *f)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static u32 fheap_find_min(fheap_t *f)
static u32 fheap_is_empty(fheap_t *f)