src/cx/mempool.h

changeset 1325
20caf6efaf07
parent 1323
deccdb82f24e
equal deleted inserted replaced
1324:399f7bb81d11 1325:20caf6efaf07
170 CxMempool *cxMempoolCreate(size_t capacity, enum cx_mempool_type type); 170 CxMempool *cxMempoolCreate(size_t capacity, enum cx_mempool_type type);
171 171
172 /** 172 /**
173 * Sets the global destructor for all memory blocks within the specified pool. 173 * Sets the global destructor for all memory blocks within the specified pool.
174 * 174 *
175 * @param pool (@c CxMempool*) the memory pool 175 * @param pool the memory pool
176 * @param fnc (@c cx_destructor_func) the destructor that shall be applied to all memory blocks 176 * @param fnc the destructor that shall be applied to all memory blocks
177 */ 177 */
178 #define cxMempoolGlobalDestructor(pool, fnc) \ 178 cx_attr_nonnull_arg(1)
179 (pool)->destr = (cx_destructor_func)(fnc) 179 cx_attr_export
180 void cxMempoolGlobalDestructor(CxMempool *pool, cx_destructor_func fnc);
180 181
181 /** 182 /**
182 * Sets the global destructor for all memory blocks within the specified pool. 183 * Sets the global destructor for all memory blocks within the specified pool.
183 * 184 *
184 * @param pool (@c CxMempool*) the memory pool 185 * @param pool the memory pool
185 * @param fnc (@c cx_destructor_func2) the destructor that shall be applied to all memory blocks 186 * @param fnc the destructor that shall be applied to all memory blocks
186 * @param data (@c void*) additional data for the destructor function 187 * @param data additional data for the destructor function
187 */ 188 */
188 #define cxMempoolGlobalDestructor2(pool, fnc, data) \ 189 cx_attr_nonnull_arg(1)
189 (pool)->destr2 = (cx_destructor_func2)(fnc); (pool)->destr2_data = (data) 190 cx_attr_export
191 void cxMempoolGlobalDestructor2(CxMempool *pool, cx_destructor_func2 fnc, void *data);
190 192
191 /** 193 /**
192 * Creates a basic array-based memory pool. 194 * Creates a basic array-based memory pool.
193 * 195 *
194 * @param capacity (@c size_t) the initial capacity of the pool 196 * @param capacity (@c size_t) the initial capacity of the pool

mercurial