ucx/cx/mempool.h

changeset 16
04c9f8d8f03b
parent 11
0aa8cbd7912e
child 21
5ea41679e15d
--- a/ucx/cx/mempool.h	Sun Feb 16 17:38:07 2025 +0100
+++ b/ucx/cx/mempool.h	Tue Feb 25 21:12:11 2025 +0100
@@ -26,11 +26,11 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /**
- * \file mempool.h
- * \brief Interface for memory pool implementations.
- * \author Mike Becker
- * \author Olaf Wintermann
- * \copyright 2-Clause BSD License
+ * @file mempool.h
+ * @brief Interface for memory pool implementations.
+ * @author Mike Becker
+ * @author Olaf Wintermann
+ * @copyright 2-Clause BSD License
  */
 
 #ifndef UCX_MEMPOOL_H
@@ -80,6 +80,7 @@
  *
  * @param pool the memory pool to free
  */
+cx_attr_export
 void cxMempoolFree(CxMempool *pool);
 
 /**
@@ -89,20 +90,21 @@
  *
  * @param capacity the initial capacity of the pool
  * @param destr optional destructor function to use for allocated memory
- * @return the created memory pool or \c NULL if allocation failed
+ * @return the created memory pool or @c NULL if allocation failed
  */
 cx_attr_nodiscard
 cx_attr_malloc
 cx_attr_dealloc(cxMempoolFree, 1)
+cx_attr_export
 CxMempool *cxMempoolCreate(size_t capacity, cx_destructor_func destr);
 
 /**
  * Creates a basic array-based memory pool.
  *
- * @param capacity the initial capacity of the pool
- * @return the created memory pool or \c NULL if allocation failed
+ * @param capacity (@c size_t) the initial capacity of the pool
+ * @return (@c CxMempool*) the created memory pool or @c NULL if allocation failed
  */
-#define cxBasicMempoolCreate(capacity) cxMempoolCreate(capacity, NULL)
+#define cxMempoolCreateSimple(capacity) cxMempoolCreate(capacity, NULL)
 
 /**
  * Sets the destructor function for a specific allocated memory object.
@@ -114,6 +116,7 @@
  * @param fnc the destructor function
  */
 cx_attr_nonnull
+cx_attr_export
 void cxMempoolSetDestructor(
         void *memory,
         cx_destructor_func fnc
@@ -128,6 +131,7 @@
  * @param memory the object allocated in the pool
  */
 cx_attr_nonnull
+cx_attr_export
 void cxMempoolRemoveDestructor(void *memory);
 
 /**
@@ -141,9 +145,11 @@
  * @param pool the pool
  * @param memory the object to register (MUST NOT be already allocated in the pool)
  * @param destr the destructor function
- * @return zero on success, non-zero on failure
+ * @retval zero success
+ * @retval non-zero failure
  */
 cx_attr_nonnull
+cx_attr_export
 int cxMempoolRegister(
         CxMempool *pool,
         void *memory,

mercurial