450 my_object_init(obj); |
450 my_object_init(obj); |
451 |
451 |
452 /* register destructor function */ |
452 /* register destructor function */ |
453 ucx_mempool_set_destr(obj, (ucx_destructor) my_object_destroy); |
453 ucx_mempool_set_destr(obj, (ucx_destructor) my_object_destroy); |
454 ``` |
454 ``` |
455 But aware, that your destructor function should not free any memory, that is |
455 Be aware, that your destructor function should not free any memory, that is |
456 also managed by the pool. |
456 also managed by the pool. |
457 Otherwise you might be risking a double-free. |
457 Otherwise you might be risking a double-free. |
458 |
458 |
459 ## Properties |
459 ## Properties |
460 |
460 |