79 void * _clib_fifo_resize (
void * v_old,
uword n_new_elts,
uword elt_bytes)
81 void * v_new, * end, * head;
82 uword n_old_elts, header_bytes;
83 uword n_copy_bytes, n_zero_bytes;
87 n_new_elts += n_old_elts;
96 v_new += header_bytes;
101 _vec_len (v_new) = n_new_elts;
104 n_copy_bytes = n_old_elts * elt_bytes;
105 if (n_copy_bytes > 0)
108 end = v_old + _vec_len (v_old) * elt_bytes;
111 if (head + n_copy_bytes >= end)
113 uword n = end - head;
122 n_zero_bytes = (n_new_elts - n_old_elts) * elt_bytes;
123 memset (v_new + n_copy_bytes, 0, n_zero_bytes);
always_inline uword max_pow2(uword x)
always_inline uword clib_fifo_elts(void *v)
always_inline clib_fifo_header_t * clib_fifo_header(void *f)
#define clib_mem_alloc_no_fail(size)
#define clib_memcpy(a, b, c)
#define clib_fifo_free(f)
always_inline uword vec_header_bytes(uword header_bytes)