lib: update documentation of some *_free functions
authorStephen Hemminger <stephen@networkplumber.org>
Wed, 9 Feb 2022 19:17:13 +0000 (11:17 -0800)
committerThomas Monjalon <thomas@monjalon.net>
Sat, 12 Feb 2022 11:05:01 +0000 (12:05 +0100)
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
lib/mempool/rte_mempool.h
lib/ring/rte_ring.h

index 6067aad..7fa9702 100644 (file)
@@ -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);
index 1e7a3c1..1d3cdf7 100644 (file)
@@ -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);
index ab6b424..980e92e 100644 (file)
@@ -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);