cp_mempool

Section: libcprops - cp_mempool (3)
Updated: SEPTEMBER 2006
Index Return to Main Contents [view source]
 

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)


 

Index

NAME
DESCRIPTION
INTERFACE
AUTHOR
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 17:58:11 GMT, September 08, 2006
SourceForge.net Logo