<< Previous | Next >> | |
|
xmem long pxalloc_fast( Pool_t * p );
Description
- Return next available free element from the given pool. Eventually, your application should return this element to the pool using
pxfree()
to avoid memory leaks.
- This is an assembler-only version of
pxalloc()
.
- *** Do _not_ call this function from C. ***
pxalloc_fast
does not perform any IPSET protection, parameter validation, or update the high-water mark.pxalloc_fast
is a root function. The parameter must be passed in IX, and the returned element address is in BCDE.Registers
- Parameter in IX
Trashes AF, HL
Return value in BCDE, carry flag.Example
ld ix,my_pool
lcall pxalloc_fast
jr c,.no_free
; BCDE points to elementParameters
- p
- Pool handle structure, as previously passed to
pool_init()
Pass this in the IX register.
Return value
- C flag set: No free elements are available. (BCDE is undefined in this case.)
- NC flag: BCDE points to an element If the pool is not linked, your application must not write more than
p->elsize
bytes to it (this was theelsize
parameter passed topool_xinit()
). If the pool is linked, you can write (p->elsize-8
) bytes to it. (An element has 8 bytes of overhead when the pool is linked.)Library
- POOL.LIB
See Also
- pool_init, pfree_fast, pavail_fast, pxalloc
Dynamic C Functions | << Previous | Next >> | rabbit.com |