From 78af0a8c5ff1a33ff8dccb1b2ea6ffadb8ef7b62 Mon Sep 17 00:00:00 2001 From: Benoît Ganne Date: Mon, 29 Apr 2019 17:27:24 +0200 Subject: vppinfra: add clib_mem_free_s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IPsec zero-es all allocated key memory including memory sur-allocated by the allocator. Move it to its own function in clib mem infra to make it easier to instrument. Type: refactor Change-Id: Icd1c44d18b741e723864abce75ac93e2eff74b61 Signed-off-by: Benoît Ganne --- src/vppinfra/mem.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/vppinfra') diff --git a/src/vppinfra/mem.h b/src/vppinfra/mem.h index f2930a11253..e565757ed3e 100644 --- a/src/vppinfra/mem.h +++ b/src/vppinfra/mem.h @@ -272,6 +272,14 @@ clib_mem_size (void *p) #endif } +always_inline void +clib_mem_free_s (void *p) +{ + uword size = clib_mem_size (p); + memset_s_inline (p, size, 0, size); + clib_mem_free (p); +} + always_inline void * clib_mem_get_heap (void) { -- cgit 1.2.3-korg