cp_mempool

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

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)


 

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