<< Previous | Next >>

xrelease

void xrelease( long addr, long sz );

Description

Release a block of memory previously obtained by xalloc() or by xavail() 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 to xalloc()/xrelease() must be nested in first-allocated/last-released order, similar to the execution stack. The addr parameter must be the return value from xalloc(). If not, then a run-time exception will occur. The sz 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 than xalloc(). For this reason, it is recommended that your application consistently uses _xalloc() rather than xalloc() 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