cp_mempool

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

NAME

cp_mempool_create, cp_mempool_create_by_option - create a memory pool

 

SYNOPSIS

#include <cprops/mempool.h>

cp_mempool *cp_mempool_create(const size_t chunksize);
cp_mempool *cp_mempool_create_by_option(const int mode,
                                         const size_t chunksize,
                                         size_t multiple);

 

DESCRIPTION

cp_mempool_create instiantiates a memory pool serving chunksize byte items. Internally the memory pool allocates several pages at a time, and serves pointers to chunksize memory areas inside these blocks.

cp_mempool_create_by_option allows setting mode bit flags and the number of chunksize items to fit in an internal allocation block.

When creating a pool with cp_mempool_create, allocation and deallocation operations, i.e. cp_mempool_alloc(3) and cp_mempool_free(3), are not synchronized by default. If you choose to share a memory pool between different threads, unset the COLLECTION_MODE_NOSYNC mode bit or create the pool using cp_mempool_create_by_mode.

 

RETURN VALUE

a pointer to a newly allocated cp_mempool object or NULL on failure.

 

SEE ALSO

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


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
SEE ALSO

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