Important: The information in this document is obsolete and should not be used for new development.
SetPtrSize
You can use theSetPtrSize
procedure to change the logical size of the nonrelocatable block corresponding to a pointer.
PROCEDURE SetPtrSize (p: Ptr; newSize: Size);
p
- A pointer to a nonrelocatable block.
newSize
- The desired new logical size, in bytes, of the nonrelocatable block.
DESCRIPTION
TheSetPtrSize
procedure attempts to change the logical size of the nonrelocatable block pointed to byp
. The new logical size is specified bynewSize
.An attempt to increase the size of a nonrelocatable block might fail because of a block above it that is either nonrelocatable or locked. You should be prepared for this possibility.
SPECIAL CONSIDERATIONS
BecauseSetPtrSize
allocates memory, you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit forSetPtrSize
are
Registers on entry A0 Pointer to the nonrelocatable block D0 Desired new size of nonrelocatable block
Registers on exit D0 Result code RESULT CODES
noErr 0 No error memFullErr -108 Not enough memory memWZErr -111 Attempt to operate on a free block