diff options
author | Dave Barach <dave@barachs.net> | 2018-10-17 10:38:51 -0400 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-10-23 13:06:46 +0000 |
commit | b7b929931a07fbb27b43d5cd105f366c3e29807e (patch) | |
tree | 438681c89738802dbb5d339715b96ea2c31bafb4 /src/vppinfra/valloc.c | |
parent | b9a4c445c1d4e9cdab476a8e1fb8a46ff0fc6080 (diff) |
c11 safe string handling support
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vppinfra/valloc.c')
-rw-r--r-- | src/vppinfra/valloc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/vppinfra/valloc.c b/src/vppinfra/valloc.c index cd1d89bb9a1..927802bfeb1 100644 --- a/src/vppinfra/valloc.c +++ b/src/vppinfra/valloc.c @@ -68,7 +68,7 @@ clib_valloc_add_chunk (clib_valloc_main_t * vam, 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) { @@ -102,7 +102,7 @@ clib_valloc_add_chunk (clib_valloc_main_t * vam, 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); @@ -130,7 +130,7 @@ 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); @@ -180,7 +180,7 @@ clib_valloc_alloc (clib_valloc_main_t * vam, uword size, 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; @@ -271,7 +271,7 @@ clib_valloc_free (clib_valloc_main_t * vam, uword baseva) 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; @@ -295,7 +295,7 @@ clib_valloc_free (clib_valloc_main_t * vam, uword baseva) 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); } } |