[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH v2] lib/ukalloc: Add uk_zalloc



Add convenience macro to allocate a single element zeroed out memory.

Signed-off-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>
---
 lib/ukalloc/include/uk/alloc.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/ukalloc/include/uk/alloc.h b/lib/ukalloc/include/uk/alloc.h
index c62d93d..634bb3f 100644
--- a/lib/ukalloc/include/uk/alloc.h
+++ b/lib/ukalloc/include/uk/alloc.h
@@ -50,6 +50,9 @@ struct uk_alloc;
 extern "C" {
 #endif
 
+#define uk_zalloc(a, size)  uk_calloc(a, 1, size)
+#define uk_do_zalloc(a, size) uk_do_calloc(a, 1, size)
+
 struct uk_alloc *uk_alloc_get_default(void);
 int uk_alloc_set_default(struct uk_alloc *a);
 
-- 
2.7.4


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.