if (index == ~0 || template->baseva < ch->baseva)
{
pool_get (vam->chunks, new_ch);
- memset (new_ch, 0, sizeof (*new_ch));
+ clib_memset (new_ch, 0, sizeof (*new_ch));
if (index != ~0)
{
index = ch - vam->chunks;
pool_get (vam->chunks, new_ch);
- memset (new_ch, 0, sizeof (*new_ch));
+ clib_memset (new_ch, 0, sizeof (*new_ch));
ch = pool_elt_at_index (vam->chunks, index);
@param template - clib_valloc_chunk_t * pointer to a template chunk which
describes the initial virtual address range
*/
-void
+__clib_export void
clib_valloc_init (clib_valloc_main_t * vam, clib_valloc_chunk_t * template,
int need_lock)
{
ASSERT (template && template->baseva && template->size);
- memset (vam, 0, sizeof (*vam));
+ clib_memset (vam, 0, sizeof (*vam));
if (need_lock)
clib_spinlock_init (&vam->lock);
@os_out_of_memory_on_failure - 1=> panic on allocation failure
@return uword allocated space, 0=> failure
*/
-uword
+__clib_export uword
clib_valloc_alloc (clib_valloc_main_t * vam, uword size,
int os_out_of_memory_on_failure)
{
pool_get (vam->chunks, new_ch);
/* ch might have just moved */
ch = pool_elt_at_index (vam->chunks, index);
- memset (new_ch, 0, sizeof (*new_ch));
+ clib_memset (new_ch, 0, sizeof (*new_ch));
new_ch->next = new_ch->prev = ~0;
new_ch->baseva = ch->baseva + size;
new_ch->size = ch->size - size;
@note the size is returned since we know it / in case the caller
doesn't memorize chunk sizes
*/
-uword
+__clib_export uword
clib_valloc_free (clib_valloc_main_t * vam, uword baseva)
{
clib_valloc_chunk_t *ch, *prev_ch, *next_ch, *n2_ch;
next_ch->prev = ch->prev;
}
ASSERT (ch - vam->chunks != vam->first_index);
- memset (ch, 0xfe, sizeof (*ch));
+ clib_memset (ch, 0xfe, sizeof (*ch));
pool_put (vam->chunks, ch);
/* See about combining with next elt */
ch = prev_ch;
n2_ch->prev = ch - vam->chunks;
}
ASSERT (next_ch - vam->chunks != vam->first_index);
- memset (next_ch, 0xfe, sizeof (*ch));
+ clib_memset (next_ch, 0xfe, sizeof (*ch));
pool_put (vam->chunks, next_ch);
}
}