Important: The information in this document is obsolete and should not be used for new development.
SetHandleSize
You can use theSetHandleSizeprocedure to change the logical size of the relocatable block corresponding to a handle.
PROCEDURE SetHandleSize (h: Handle; newSize: Size);
h- A handle to a relocatable block.
newSize- The desired new logical size, in bytes, of the relocatable block.
DESCRIPTION
TheSetHandleSizeprocedure attempts to change the logical size of the relocatable block whose handle ish. The new logical size is specified bynewSize.SetHandleSizemight 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.
SPECIAL CONSIDERATIONS
BecauseSetHandleSizeallocates memory, you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit forSetHandleSizeare
Registers on entry A0 Handle to the relocatable block D0 Desired new size of relocatable block
Registers on exit D0 Result code RESULT CODES
noErr 0 No error memFullErr -108 Not enough memory nilHandleErr -109 NILmaster pointermemWZErr -111 Attempt to operate on a free block SEE ALSO
Instead of using theSetHandleSizeprocedure to set the size of a handle to 0, you can use theEmptyHandleprocedure, described on page 2-51.