long pxalloc( 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.
Parameters
- p
- Pool handle structure, as previously passed to
pool_xinit().
Return value
-
0: No free elements are available.
-
!0: Physical (xmem address) of an element. If the pool is not linked, your application can use
this element provided it does not write more than p->elsize bytes to it (this was the
elsize parameter passed to pool_xinit()). If the pool is linked, you can write up to
(p->elsize-8) bytes to it. (Each element has 8 bytes of overhead when the pool is
linked.)
Library
- POOL.LIB
See Also
- pool_xinit, pxcalloc, pxfree, phwm, pavail