Type: fix
When freeing an uninstantiated bihash
created with dont_add_to_all_bihash_list = 1
we get a warning. This removes the
warning & the search for the bihash on
cleanup.
Change-Id: Iac50ce7e30b97925768f7ad3cb1d30af14686e21
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
h->log2_nbuckets = max_log2 (a->nbuckets);
h->memory_size = BIHASH_USE_HEAP ? 0 : a->memory_size;
h->instantiated = 0;
h->log2_nbuckets = max_log2 (a->nbuckets);
h->memory_size = BIHASH_USE_HEAP ? 0 : a->memory_size;
h->instantiated = 0;
+ h->dont_add_to_all_bihash_list = a->dont_add_to_all_bihash_list;
h->fmt_fn = BV (format_bihash);
h->kvp_fmt_fn = a->kvp_fmt_fn;
h->fmt_fn = BV (format_bihash);
h->kvp_fmt_fn = a->kvp_fmt_fn;
clib_mem_vm_free ((void *) (uword) (alloc_arena (h)),
alloc_arena_size (h));
never_initialized:
clib_mem_vm_free ((void *) (uword) (alloc_arena (h)),
alloc_arena_size (h));
never_initialized:
+ if (h->dont_add_to_all_bihash_list)
+ {
+ clib_memset_u8 (h, 0, sizeof (*h));
+ return;
+ }
clib_memset_u8 (h, 0, sizeof (*h));
for (i = 0; i < vec_len (clib_all_bihashes); i++)
{
clib_memset_u8 (h, 0, sizeof (*h));
for (i = 0; i < vec_len (clib_all_bihashes); i++)
{
u64 alloc_arena; /* Base of the allocation arena */
volatile u8 instantiated;
u64 alloc_arena; /* Base of the allocation arena */
volatile u8 instantiated;
+ u8 dont_add_to_all_bihash_list;
/**
* A custom format function to print the Key and Value of bihash_key instead of default hexdump
/**
* A custom format function to print the Key and Value of bihash_key instead of default hexdump