summaryrefslogtreecommitdiffstats
path: root/vlib-api/vlibmemory/api.h
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2016-10-13 17:35:09 -0400
committerDave Barach <dave@barachs.net>2016-10-13 17:36:12 -0400
commit77378332ac585f0558a640b148bac0308675a459 (patch)
tree3ead2587c0a6da74d30be37aca84cf683883caa0 /vlib-api/vlibmemory/api.h
parent770930c45f9793151e2c39b5834b1c8e7210bbe6 (diff)
add xxx_or_null(...) message buffer allocation variants
Useful when attempting to serialize potentially very large data structures and send them to API clients. NULL pointer checks are MANDATORY when calling xxx_or_null(...) variant functions. Change-Id: I6ae272deb7150a2c5aa82ec45a206e5bddee7a02 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vlib-api/vlibmemory/api.h')
-rw-r--r--vlib-api/vlibmemory/api.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/vlib-api/vlibmemory/api.h b/vlib-api/vlibmemory/api.h
index bc4cfbf49b3..825891cf9ed 100644
--- a/vlib-api/vlibmemory/api.h
+++ b/vlib-api/vlibmemory/api.h
@@ -124,7 +124,9 @@ vl_msg_api_handle_from_index_and_epoch (u32 index, u32 epoch)
}
void *vl_msg_api_alloc (int nbytes);
+void *vl_msg_api_alloc_or_null (int nbytes);
void *vl_msg_api_alloc_as_if_client (int nbytes);
+void *vl_msg_api_alloc_as_if_client_or_null (int nbytes);
void vl_msg_api_free (void *a);
int vl_map_shmem (char *region_name, int is_vlib);
void vl_register_mapped_shmem_region (svm_region_t * rp);