MINOR: pools: add pool_zalloc() to return a zeroed area
It's like pool_alloc() but the output is zeroed before being returned
and is never poisonned.
diff --git a/include/haproxy/pool.h b/include/haproxy/pool.h
index b37fb9d..ce13710 100644
--- a/include/haproxy/pool.h
+++ b/include/haproxy/pool.h
@@ -326,6 +326,15 @@
}
/*
+ * Returns a pointer to type <type> taken from the pool <pool_type> or
+ * dynamically allocated. The area is zeroed.
+ */
+static inline void *pool_zalloc(struct pool_head *pool)
+{
+ return __pool_alloc(pool, POOL_F_MUST_ZERO);
+}
+
+/*
* Puts a memory area back to the corresponding pool.
* Items are chained directly through a pointer that
* is written in the beginning of the memory area, so