Important: The information in this document is obsolete and should not be used for new development.
EmptyHandle
TheEmptyHandleprocedure allows you to free memory taken by a relocatable block without freeing the relocatable block's master pointer for other uses.
PROCEDURE EmptyHandle (h: Handle);
h- A handle to a relocatable block.
DESCRIPTION
TheEmptyHandleprocedure purges the relocatable block whose handle ishand sets the handle's master pointer toNIL. The block whose handle ishmust be unlocked but need not be purgeable.
- Note
- If there are multiple handles to the relocatable block, then calling
theEmptyHandleprocedure empties them all, because all of the handles share a common master pointer. When you later useReallocateHandleto reallocate space for the block, the master pointer is updated, and all of the handles reference the new block correctly.![]()
SPECIAL CONSIDERATIONS
BecauseEmptyHandlepurges memory, you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit forEmptyHandleare
Registers on entry A0 Handle to relocatable block
Registers on exit A0 Handle to relocatable block D0 Result code RESULT CODES
noErr 0 No error memWZErr -111 Attempt to operate on a free block memPurErr -112 Attempt to purge a locked block SEE ALSO
To purge all of the blocks in a heap zone that are marked purgeable, use thePurgeMemprocedure, described on page 2-73.To free the memory taken up by a relocatable block and release the block's master pointer for other uses, use the
DisposeHandleprocedure, described on page 2-34.