cp_shared_mempool_alloc(3)
| cp_mempool(3) | libcprops - cp_mempool | cp_mempool(3) |
NAME
cp_shared_mempool_alloc, cp_shared_mempool_calloc - obtain memory block from a shareable memory pool
SYNOPSIS
#include <cprops/mempool.h>
void *cp_shared_mempool_alloc(cp_shared_mempool
*pool, size_t size);
void *cp_shared_mempool_calloc(cp_shared_mempool *pool,
size_t size);
DESCRIPTION
cp_shared_mempool_alloc attempts to obtain a memory block of at least size bytes from the shared memory pool pool. cp_shared_mempool_calloc is the same, but also sets the content of the returned memory block to zeros.
For best results, use cp_shared_mempool to allocate fixed size blocks and register these sizes with the pool with cp_shared_mempool_register(3) in advance. cp_shared_mempool may also be used for arbitrary sized allocations, but this entails a larger allocation overhead and may be slower than native malloc/ free on some platforms.
RETURN VALUE
A memory block of at least size bytes on success or NULL on failure.
SEE ALSO
cp_shared_mempool_register(3), cp_shared_mempool_free(3), cp_mempool(3)
| SEPTEMBER 2006 | libcprops.0.1.6 |
