--- a/src/cx/mempool.h Thu May 22 21:00:33 2025 +0200 +++ b/src/cx/mempool.h Thu May 22 22:22:14 2025 +0200 @@ -172,21 +172,23 @@ /** * Sets the global destructor for all memory blocks within the specified pool. * - * @param pool (@c CxMempool*) the memory pool - * @param fnc (@c cx_destructor_func) the destructor that shall be applied to all memory blocks + * @param pool the memory pool + * @param fnc the destructor that shall be applied to all memory blocks */ -#define cxMempoolGlobalDestructor(pool, fnc) \ - (pool)->destr = (cx_destructor_func)(fnc) +cx_attr_nonnull_arg(1) +cx_attr_export +void cxMempoolGlobalDestructor(CxMempool *pool, cx_destructor_func fnc); /** * Sets the global destructor for all memory blocks within the specified pool. * - * @param pool (@c CxMempool*) the memory pool - * @param fnc (@c cx_destructor_func2) the destructor that shall be applied to all memory blocks - * @param data (@c void*) additional data for the destructor function + * @param pool the memory pool + * @param fnc the destructor that shall be applied to all memory blocks + * @param data additional data for the destructor function */ -#define cxMempoolGlobalDestructor2(pool, fnc, data) \ - (pool)->destr2 = (cx_destructor_func2)(fnc); (pool)->destr2_data = (data) +cx_attr_nonnull_arg(1) +cx_attr_export +void cxMempoolGlobalDestructor2(CxMempool *pool, cx_destructor_func2 fnc, void *data); /** * Creates a basic array-based memory pool.