src/cx/mempool.h

changeset 1426
3a89b31f0724
parent 1329
343eac5ac824
--- a/src/cx/mempool.h	Wed Oct 15 22:45:21 2025 +0200
+++ b/src/cx/mempool.h	Thu Oct 16 19:57:47 2025 +0200
@@ -156,8 +156,7 @@
  *
  * @param pool the memory pool to free
  */
-cx_attr_export
-void cxMempoolFree(CxMempool *pool);
+CX_EXPORT void cxMempoolFree(CxMempool *pool);
 
 /**
  * Creates an array-based memory pool.
@@ -169,11 +168,8 @@
  * @param type the type of memory pool
  * @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, enum cx_mempool_type type);
+cx_attr_nodiscard cx_attr_malloc cx_attr_dealloc(cxMempoolFree, 1)
+CX_EXPORT CxMempool *cxMempoolCreate(size_t capacity, enum cx_mempool_type type);
 
 /**
  * Creates a basic array-based memory pool.
@@ -212,8 +208,7 @@
  * @param fnc the destructor that shall be applied to all memory blocks
  */
 cx_attr_nonnull_arg(1)
-cx_attr_export
-void cxMempoolGlobalDestructor(CxMempool *pool, cx_destructor_func fnc);
+CX_EXPORT void cxMempoolGlobalDestructor(CxMempool *pool, cx_destructor_func fnc);
 
 /**
  * Sets the global destructor for all memory blocks within the specified pool.
@@ -223,8 +218,7 @@
  * @param data additional data for the destructor function
  */
 cx_attr_nonnull_arg(1)
-cx_attr_export
-void cxMempoolGlobalDestructor2(CxMempool *pool, cx_destructor_func2 fnc, void *data);
+CX_EXPORT void cxMempoolGlobalDestructor2(CxMempool *pool, cx_destructor_func2 fnc, void *data);
 
 /**
  * Sets the destructor function for a specific allocated memory object.
@@ -237,11 +231,7 @@
  * @param fnc the destructor function
  */
 cx_attr_nonnull
-cx_attr_export
-void cxMempoolSetDestructor(
-        void *memory,
-        cx_destructor_func fnc
-);
+CX_EXPORT void cxMempoolSetDestructor(void *memory, cx_destructor_func fnc);
 
 /**
  * Sets the destructor function for a specific allocated memory object.
@@ -255,12 +245,7 @@
  * @param data additional data for the destructor function
  */
 cx_attr_nonnull
-cx_attr_export
-void cxMempoolSetDestructor2(
-        void *memory,
-        cx_destructor_func2 fnc,
-        void *data
-);
+CX_EXPORT void cxMempoolSetDestructor2(void *memory, cx_destructor_func2 fnc, void *data);
 
 /**
  * Removes the destructor function for a specific allocated memory object.
@@ -271,8 +256,7 @@
  * @param memory the object allocated in the pool
  */
 cx_attr_nonnull
-cx_attr_export
-void cxMempoolRemoveDestructor(void *memory);
+CX_EXPORT void cxMempoolRemoveDestructor(void *memory);
 
 /**
  * Removes the destructor function for a specific allocated memory object.
@@ -283,8 +267,7 @@
  * @param memory the object allocated in the pool
  */
 cx_attr_nonnull
-cx_attr_export
-void cxMempoolRemoveDestructor2(void *memory);
+CX_EXPORT void cxMempoolRemoveDestructor2(void *memory);
 
 /**
  * Registers foreign memory with this pool.
@@ -302,12 +285,7 @@
  * @retval non-zero failure
  */
 cx_attr_nonnull
-cx_attr_export
-int cxMempoolRegister(
-        CxMempool *pool,
-        void *memory,
-        cx_destructor_func destr
-);
+CX_EXPORT int cxMempoolRegister(CxMempool *pool, void *memory, cx_destructor_func destr);
 
 
 /**
@@ -330,13 +308,7 @@
  * @retval non-zero failure
  */
 cx_attr_nonnull
-cx_attr_export
-int cxMempoolRegister2(
-        CxMempool *pool,
-        void *memory,
-        cx_destructor_func2 destr,
-        void *data
-);
+CX_EXPORT int cxMempoolRegister2(CxMempool *pool, void *memory, cx_destructor_func2 destr, void *data);
 
 /**
  * Transfers all the memory managed by one pool to another.
@@ -354,11 +326,7 @@
  * @retval non-zero allocation failure or incompatible pools
  */
 cx_attr_nonnull
-cx_attr_export
-int cxMempoolTransfer(
-        CxMempool *source,
-        CxMempool *dest
-);
+CX_EXPORT int cxMempoolTransfer(CxMempool *source, CxMempool *dest);
 
 /**
  * Transfers an object from one pool to another.
@@ -375,12 +343,7 @@
  * @retval non-zero failure, or the object was not found in the source pool, or the pools are incompatible
  */
 cx_attr_nonnull
-cx_attr_export
-int cxMempoolTransferObject(
-        CxMempool *source,
-        CxMempool *dest,
-        const void *obj
-);
+CX_EXPORT int cxMempoolTransferObject(CxMempool *source, CxMempool *dest, const void *obj);
 
 #ifdef __cplusplus
 } // extern "C"

mercurial