Carbon


SetHandleSize

Header: MacMemory.h Carbon status: Supported

Changes the logical size of the relocatable block corresponding to the specified handle.

void SetHandleSize (
    Handle h, 
    Size newSize
);
Parameter descriptions
h

A handle to a relocatable block.

newSize

The desired new logical size, in bytes, of the relocatable block.

DISCUSSION

SetHandleSize might need to move the relocatable block to obtain enough space for the resized block. Thus, for best results you should unlock a block before resizing it.

An attempt to increase the size of a locked block might fail, because of blocks above and below it that are either nonrelocatable or locked. You should be prepared for this possibility.

Instead of using the SetHandleSize function to set the size of a handle to 0, you can use the EmptyHandle function.

Call the function MemError to get the result code. See “Result Codes”.

Because SetHandleSize allocates memory, you should not call it at interrupt time.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


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