Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Memory /
Chapter 2 - Memory Manager / Memory Manager Reference
Memory Manager Routines / Changing the Sizes of Relocatable and Nonrelocatable Blocks


SetPtrSize

You can use the SetPtrSize 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
The SetPtrSize procedure attempts to change the logical size of the nonrelocatable block pointed to by p. The new logical size is specified by newSize.

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
Because SetPtrSize allocates memory, you should not call it at interrupt time.

ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit for SetPtrSize are
Registers on entry
A0Pointer to the nonrelocatable block
D0Desired new size of nonrelocatable block
Registers on exit
D0Result code

RESULT CODES
noErr0No error
memFullErr-108Not enough memory
memWZErr-111Attempt to operate on a free block

Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996