]> git.droids-corp.org - dpdk.git/commitdiff
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 6067aad954317b7407c6d582fef50ce640bd5d83..7fa9702742a9eef8c053835cd0a758f60bc707f6 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 1e7a3c15273c5e869b1258f4ec841ab3d02a2e53..1d3cdf7f22093bfd7d6f56226e6e5529442ce679 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 ab6b4244c89e85e26a265341900ac5f21bd0ba51..980e92e59493066ae18e878ff1c7a577824e1147 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);