Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Memory /
Chapter 1 - Introduction to Memory Management / Memory Management Reference
Memory Management Routines / Allocating and Releasing Relocatable Blocks of Memory


DisposeHandle

When you are completely done with a relocatable block, call the DisposeHandle procedure to free it and its master pointer for other uses.

PROCEDURE DisposeHandle (h: Handle);
h
A handle to a relocatable block.
DESCRIPTION
The DisposeHandle procedure releases the memory occupied by the relocatable block whose handle is h. It also frees the handle's master pointer for other uses.

WARNING
After a call to DisposeHandle, all handles to the released block become invalid and should not be used again. Any subsequent calls to DisposeHandle using an invalid handle might damage the master pointer list.
Do not use DisposeHandle to dispose of a handle obtained from the Resource Manager (for example, by a previous call to GetResource); use ReleaseResource instead. If, however, you have called DetachResource on a resource handle, you should dispose of the storage by calling DisposeHandle.

SPECIAL CONSIDERATIONS
Because DisposeHandle purges memory, you should not call it at interrupt time.

ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit for DisposeHandle are
Registers on entry
A0Handle to the relocatable block to be disposed of
Registers on exit
D0Result code

RESULT CODES
noErr0No error
memWZErr-111Attempt to operate on a free block

Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996