Whenever we can implement as static inline rather than macro, it's
better (type checking of arguments, less chances of hitting preprocessor
aweful semantic corner-cases....).
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
/*
* Memory allocation zeroed
*/
-#define zmalloc(x) calloc(1, x)
+static inline
+void *zmalloc(size_t len)
+{
+ return calloc(1, len);
+}
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(array) (sizeof(array) / (sizeof((array)[0])))