| 154 CxMempool *pool, |
154 CxMempool *pool, |
| 155 void *memory, |
155 void *memory, |
| 156 cx_destructor_func destr |
156 cx_destructor_func destr |
| 157 ); |
157 ); |
| 158 |
158 |
| |
159 /** |
| |
160 * Transfers all the memory managed by one pool to another. |
| |
161 * |
| |
162 * The allocator of the source pool will also be transferred and registered with the destination pool |
| |
163 * and stays valid, as long as the destination pool is not destroyed. |
| |
164 * |
| |
165 * The source pool will get a completely new allocator and can be reused or destroyed afterward. |
| |
166 * |
| |
167 * @param source the pool to move the memory from |
| |
168 * @param dest the pool where to transfer the memory to |
| |
169 * @retval zero success |
| |
170 * @retval non-zero failure |
| |
171 */ |
| |
172 cx_attr_nonnull |
| |
173 cx_attr_export |
| |
174 int cxMempoolTransfer( |
| |
175 CxMempool *source, |
| |
176 CxMempool *dest |
| |
177 ); |
| |
178 |
| 159 #ifdef __cplusplus |
179 #ifdef __cplusplus |
| 160 } // extern "C" |
180 } // extern "C" |
| 161 #endif |
181 #endif |
| 162 |
182 |
| 163 #endif // UCX_MEMPOOL_H |
183 #endif // UCX_MEMPOOL_H |