14 typedef struct { |
17 typedef struct { |
15 void **data; |
18 void **data; |
16 size_t ndata; |
19 size_t ndata; |
17 size_t size; |
20 size_t size; |
18 } UcxMempool; |
21 } UcxMempool; |
|
22 |
|
23 #define UCX_ALLOCATOR_MEMPOOL(pool) {pool, \ |
|
24 (ucx_allocator_malloc) ucx_mempool_malloc, \ |
|
25 (ucx_allocator_calloc) ucx_mempool_calloc, \ |
|
26 (ucx_allocator_realloc) ucx_mempool_realloc} |
19 |
27 |
20 #define ucx_mempool_new_default() ucx_mempool_new(16) |
28 #define ucx_mempool_new_default() ucx_mempool_new(16) |
21 UcxMempool *ucx_mempool_new(size_t n); |
29 UcxMempool *ucx_mempool_new(size_t n); |
22 int ucx_mempool_chcap(UcxMempool *pool, size_t newcap); |
30 int ucx_mempool_chcap(UcxMempool *pool, size_t newcap); |
23 |
31 |