#define clib_fifo_head(v) ((v) + clib_fifo_head_index (v))
#define clib_fifo_tail(v) ((v) + clib_fifo_tail_index (v))
-#define clib_fifo_free(f) vec_free_h((f),sizeof(clib_fifo_header_t))
+#define clib_fifo_free(f) vec_free ((f))
always_inline uword
clib_fifo_elt_index (void *v, uword i)
vec_free (h->free_elts);
vec_free (h->small_free_elt_free_index);
if (!(h->flags & HEAP_IS_STATIC))
- vec_free_h (v, sizeof (h[0]));
+ vec_free (v);
return v;
}
clib_bitmap_free (p->free_bitmap);
vec_free (p->free_indices);
- vec_free_h (v, pool_aligned_header_bytes);
+ vec_free (v);
return 0;
}
#define clib_ring_new(ring, size) \
{ clib_ring_new_inline ((void **)&(ring), sizeof(ring[0]), size, 0);}
-#define clib_ring_free(f) vec_free_h((f), sizeof(clib_ring_header_t))
+#define clib_ring_free(f) vec_free ((f))
always_inline u32
clib_ring_n_enq (void *v)
vec_free (handles);
if (fixed_size)
- vec_free_h (h, sizeof (heap_header_t));
+ vec_free (h);
if (verbose)
fformat (stderr, "%U\n", format_clib_mem_usage, /* verbose */ 0);
static elt_t *
validate_vec_free_h (elt_t * vec, uword hdr_bytes)
{
- vec_free_h (vec, hdr_bytes);
+ vec_free (vec);
ASSERT (vec == NULL);
return vec;
}
{
case OP_IS_VEC_INIT_H:
num_elts = bounded_random_u32 (&g_seed, 0, MAX_CHANGE);
- vec_free_h (vec, sizeof (hdr_t));
+ vec_free (vec);
VERBOSE2 ("vec_init_h(), new elts %d\n", num_elts);
vec = validate_vec_init_h (num_elts, sizeof (hdr_t));
break;
}
validate_vec (vec, sizeof (hdr_t));
- vec_free_h (vec, sizeof (hdr_t));
+ vec_free (vec);
}
static void
*/
#define vec_new_aligned(T,N,A) vec_new_ha(T,N,0,A)
-/** \brief Free vector's memory (general version)
-
+/** \brief Free vector's memory (no header).
@param V pointer to a vector
- @param H size of header in bytes
@return V (value-result parameter, V=0)
*/
-#define vec_free_h(V, H) \
+#define vec_free(V) \
do \
{ \
if (V) \
} \
while (0)
-/** \brief Free vector's memory (no header).
- @param V pointer to a vector
- @return V (value-result parameter, V=0)
-*/
-#define vec_free(V) vec_free_h(V,0)
-
void vec_free_not_inline (void *v);
/**\brief Free vector user header (syntactic sugar)