These functions all behave like libc free() and do
nothing if handed a NULL pointer. The code is already doing
this, this patch just documents the behavior.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/hash/rte_hash.h | 4 +++-
lib/mempool/rte_mempool.h | 1 +
lib/ring/rte_ring.h | 3 ++-
3 files changed, 6 insertions(+), 2 deletions(-)
@@ -174,8 +174,10 @@ rte_hash_find_existing(const char *name);
/**
* De-allocate all memory used by hash table.
+ *
* @param h
- * Hash table to free
+ * Hash table to free, if NULL, the function does nothing.
+ *
*/
void
rte_hash_free(struct rte_hash *h);
@@ -1101,6 +1101,7 @@ rte_mempool_create_empty(const char *name, unsigned n, unsigned elt_size,
*
* @param mp
* A pointer to the mempool structure.
+ * If NULL then, the function does nothing.
*/
void
rte_mempool_free(struct rte_mempool *mp);
@@ -193,7 +193,8 @@ struct rte_ring *rte_ring_create(const char *name, unsigned int count,
* De-allocate all memory used by the ring.
*
* @param r
- * Ring to free
+ * Ring to free.
+ * If NULL then, the function does nothing.
*/
void rte_ring_free(struct rte_ring *r);