HPurge
HPurge Make a relocatable block purgeable Handle theHandle ; handle to block being made purgeable HPurge sets the purge attribute of a relocatable memory block so that in a subsequent heap compaction, its data can be purged.
theHandle is a handle leading to a relocatable memory block. It is typically a
nilHandleErr (-109) Illegal operation on an empty handle
memWZErr (-111) Illegal operation on a free block
Notes: If theHandle is currently locked (see HLock), it will remain locked and HPurge will have no effect until the handle is unlocked via HUnlock. There after, theHandle will purged by the next general purge.
After a purge, all handles marked as purgeable will point to NIL master
pointers and their data area will be lost. Be very careful to check for such
empty handles before accessing the data, e.g.:
myHandle = NewHandle( 1000 ); /* allocate space */ HPurge( myHandle ); /* allow purge */ .
:
if ( *myHandle == 0 ) { /* data has been purged */
.
. /* regenerate lost data; load resource, etc. */
.
}
HNoPurge( myHandle ); [TOKEN:12074] don't allow purge now */ .
:
Use HNoPurge to undo the effect of this function (first be sure that the handle hasn't been purged!).