void * pcalloc( Pool_t * p );
Description
- Return next available free element from the given pool. Eventually, your application should return
this element to the pool using
pfree() to avoid memory leaks.
- The element is set to all zero bytes before returning.
Parameters
- p
- Pool handle structure, as previously passed to
pool_init().
Return value
- Null: No free elements were available
Otherwise, pointer to an element. If the pool is not linked, your application must not write more
than p->elsize bytes to the element (this was the elsize parameter passed to
pool_init()). The application can write up to (p->elsize-4) bytes to the element if the
pool is linked. (An element in root memory has 4 bytes of overhead when the pool is linked.)
Library
- POOL.LIB
See Also
- pool_init, palloc, pfree, phwm, pavail