<< Previous | Next >> | |
|
int pool_link( Pool_t * p, int link );
Description
- Tell the specified pool to maintain a doubly-linked list of allocated elements.
- This function should only be called when the pool is completely free; i.e.,
pavail() == pnel()Parameters
- p
- Pool handle structure, as previously passed to
pool_init()
orpool_xinit()
.
- link
- Must be one of the following:
POOL_LINKED_AUTO
(1): the pool is linked, and newly allocated elements are always added at the end of the list.
POOL_LINKED_BY_APP
(2): the pool is linked, but newly allocated elements are not added to the list. The application must callpreorder()
orpmovebetween()
to insert the element. This option is only available for root pools.- WARNING: if you set the
POOL_LINKED_BY_APP
option, then the allocated element must NOT be passed to any other pool API function except forpfree()
,preorder()
(as the "e" parameter) orpmovebetween()
(as the "e" parameter). After callingpreorder()
orpmovebetween()
, then it is safe to pass this element to all appropriate functions.
Return value
- Currently always zero. If you define the macro
POOL_DEBUG
, then parameters are checked. If the parameters look bad, then an exception is raised. You can definePOOL_VERBOSE
to getprintf()
messages.Library
- POOL.LIB
See Also
- pool_init, pool_xinit, pavail
Dynamic C Functions | << Previous | Next >> | rabbit.com |