summaryrefslogtreecommitdiffstats
path: root/src/vlibmemory/memory_shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlibmemory/memory_shared.c')
-rw-r--r--src/vlibmemory/memory_shared.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/vlibmemory/memory_shared.c b/src/vlibmemory/memory_shared.c
index 703db9da4ec..fa9936982ee 100644
--- a/src/vlibmemory/memory_shared.c
+++ b/src/vlibmemory/memory_shared.c
@@ -209,6 +209,16 @@ vl_msg_api_alloc (int nbytes)
}
void *
+vl_msg_api_alloc_zero (int nbytes)
+{
+ void *ret;
+
+ ret = vl_msg_api_alloc (nbytes);
+ clib_memset (ret, 0, nbytes);
+ return ret;
+}
+
+void *
vl_msg_api_alloc_or_null (int nbytes)
{
int pool;
@@ -226,6 +236,16 @@ vl_msg_api_alloc_as_if_client (int nbytes)
}
void *
+vl_msg_api_alloc_zero_as_if_client (int nbytes)
+{
+ void *ret;
+
+ ret = vl_msg_api_alloc_as_if_client (nbytes);
+ clib_memset (ret, 0, nbytes);
+ return ret;
+}
+
+void *
vl_msg_api_alloc_as_if_client_or_null (int nbytes)
{
return vl_msg_api_alloc_internal (nbytes, 0, 1 /* may_return_null */ );