<< Previous | Next >> | |
|
void xrelease( long addr, long sz );
Description
- Release a block of memory previously obtained by
xalloc()
or byxavail()
with a non- null parameter.xrelease()
may only be called to free the most recent block obtained. It is NOT a general-purpose malloc/free type of dynamic memory allocation. Calls toxalloc()
/xrelease()
must be nested in first-allocated/last-released order, similar to the execution stack. Theaddr
parameter must be the return value fromxalloc()
. If not, then a run-time exception will occur. Thesz
parameter must also be equal to the actual allocated size, however this is not checked. The actual allocated size may be larger than the requested size (because of alignment overhead). The actual size may be obtained by calling_xalloc()
rather thanxalloc()
. For this reason, it is recommended that your application consistently uses_xalloc()
rather thanxalloc()
if you intend to use this function.Parameters
- addr
- Address of storage previously obtained by
_xalloc()
.
- sz
- Size of storage previously returned by
_xalloc()
.
Library
- XMEM.LIB
See Also
- xalloc, _xalloc, xavail, _xavail, xalloc_stats
Dynamic C Functions | << Previous | Next >> | rabbit.com |