Carbon


TempNewHandle

Header: MacMemory.h Carbon status: Supported

Allocates a new relocatable block of temporary memory.

Handle TempNewHandle (
    Size logicalSize, 
    OSErr *resultCode
);
logicalSize

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

resultCode

On return, the result code from the function call. See “Result Codes”.

function result

A handle to a block of size logicalSize. If it cannot allocate a block of that size, the function returns NULL.

DISCUSSION

Before calling TempNewHandle, you should call TempFreeMem or TempMaxMem to make sure that there is enough free space to satisfy the request.

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

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when InterfaceLib 7.1 or later is installed. Exported by CarbonLib 1.0 and later and by InterfaceLib 7.1 and later.

CARBON NOTES

Temporary memory allocations will actually come from the applications’s address space in Mac OS X. However, Carbon applications running under Mac OS 8.x will be able to get true temporary memory.


© 2000 Apple Computer, Inc. — (Last Updated 4/6/2000)