summaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2019-04-29 17:27:24 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-10-31 12:15:33 +0000
commit952d4e7fb9fce28c36f8ff05a0a20ce528aa45f7 (patch)
treec76ec8df2b84be3fae505baa8b840cb8aa6b35a6 /src/vppinfra
parent54ff70cb3c27733a9c09ab7c2ea0a6fd69e7ea02 (diff)
vppinfra: add clib_mem_free_s
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 <bganne@cisco.com> (cherry picked from commit 78af0a8c5ff1a33ff8dccb1b2ea6ffadb8ef7b62)
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/mem.h8
1 files changed, 8 insertions, 0 deletions
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)
{