Important: The information in this document is obsolete and should not be used for new development.
SetHandleSize
You can use theSetHandleSize
procedure 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
TheSetHandleSize
procedure attempts to change the logical size of the relocatable block whose handle ish
. The new logical size is specified bynewSize
.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.
SPECIAL CONSIDERATIONS
BecauseSetHandleSize
allocates memory, you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit forSetHandleSize
are
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 NIL
master pointermemWZErr -111 Attempt to operate on a free block SEE ALSO
Instead of using theSetHandleSize
procedure to set the size of a handle to 0, you can use theEmptyHandle
procedure, described on page 2-51.