cp_mempool(3) - Linux man page

Name

cp_mempool - a memory pool implementation

Description

cp_mempool is a memory pool for fixed allocation sizes.

cp_shared_mempool(3) is a shareable memory pool implementation based on cp_mempool. Both cp_mempool and cp_shared_mempool represent a trade off of memory for speed and should not be used if memory is tight or if the total allocation may exceed the amount of physical memory available to the program, so as to prevent swapping. Note that even if using the provided cp_mempool_free or cp_shared_mempool_free functions, the memory returned to the pool is kept for future requests and is ultimately released back to the general "malloc" library only when the memory pool is destroyed.

Interface

the following is a summary of functions provided by <cprops/mempool.h>.

cp_mempool *cp_mempool_create_by_option(const int mode,

const size_t chunksize, size_t multiple);
cp_mempool *cp_mempool_create(const size_t
chunksize);
int cp_mempool_inc_refcount(cp_mempool *
pool);
void *cp_mempool_alloc(cp_mempool * const
pool);
void *cp_mempool_calloc(cp_mempool * const
pool);
int cp_mempool_free(cp_mempool * const
pool, void *data);
void cp_mempool_destroy(cp_mempool *
pool);

Author

cp_mempool was contributed to libcprops by Kyle Wheeler.

See Also

cp_mempool_create(3), cp_mempool_alloc(3), cp_mempool_free(3), cp_mempool_destroy(3), cp_shared_mempool(3)

Referenced By

cp_shared_mempool_alloc(3), cp_shared_mempool_create_by_option(3), cp_shared_mempool_destroy(3), cp_shared_mempool_free(3), cp_shared_mempool_register(3)