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 2 - Memory Manager / Memory Manager Reference
Memory Manager Routines / Allocating Temporary Memory


TempNewHandle

To allocate a new relocatable block of temporary memory, call the TempNewHandle function after making sure that there is enough free space to satisfy the request.

FUNCTION TempNewHandle (logicalSize: Size;
                        VAR resultCode: OSErr): Handle;
logicalSize

The requested logical size, in bytes, of the new temporary block of memory.
resultCode

On exit, the result code from the function call.
DESCRIPTION
The TempNewHandle function returns a handle to a block of size logicalSize. If it cannot allocate a block of that size, the function returns NIL. Before you use the returned handle, make sure its value is not NIL.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for TempNewHandle are
Trap macroSelector
_OSDispatch$001D

SPECIAL CONSIDERATIONS
Because TempNewHandle might allocate memory, you should not call it at
interrupt time.

Note that TempNewHandle returns its result code in a parameter, not through MemError.

RESULT CODES
noErr0No error
memFullErr-108Not enough memory

Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996