Important: The information in this document is obsolete and should not be used for new development.
NewEmptyHandle
If you want to initialize a handle but not allocate any space for it, use theNewEmptyHandlefunction. The Resource Manager uses this function extensively,
but you probably won't need to use it.
FUNCTION NewEmptyHandle: Handle;DESCRIPTION
TheNewEmptyHandlefunction initializes a new handle by allocating a master pointer for it, but it does not allocate any memory for the handle to control.NewEmptyHandlesets the handle's master pointer toNIL.SPECIAL CONSIDERATIONS
BecauseNewEmptyHandlemight need to call theMoreMastersprocedure to
allocate new master pointers, it might allocate memory. Thus, you should not callNewEmptyHandleat interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The registers on exit forNewEmptyHandleare
Registers on exit A0 Address of the new block's master pointer D0 Result code You can specify that the
NewEmptyHandlefunction apply to the system heap zone instead of the current zone. To do so, set bit 10 of the routine trap word. In most development systems, you can do this by supplying the wordSYSas the second argument to the routine macro, as follows:
_NewEmptyHandle ,SYSRESULT CODES
noErr 0 No error memFullErr -108 Not enough memory SEE ALSO
When you want to allocate memory for the empty handle, use theReallocateHandleprocedure, described on page 2-52.