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 / Manipulating Blocks of Memory


PtrAndHand

Use the PtrAndHand function to concatenate part or all of a memory block to the end of a relocatable block.

FUNCTION PtrAndHand (pntr: Ptr; hndl: Handle; size: LongInt): 
                     OSErr;
pntr
A pointer to the beginning of the data that the Memory Manager is to concatenate onto the end of the relocatable block.
hndl
A handle to the relocatable block, whose size the Memory Manager expands so that it can concatenate the information from pntr onto the end of this block.
size
The number of bytes of the block referenced by pntr to be copied.
DESCRIPTION
The PtrAndHand function takes the number of bytes specified by the size parameter, beginning at the location specified by pntr, and concatenates them onto the end of the relocatable block to which hndl is a handle.

The contents of the source block remain unchanged.

SPECIAL CONSIDERATIONS
Because PtrAndHand allocates memory, you should not call it at interrupt time.

ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit for PtrAndHand are
Registers on entry
A0Pointer to data to copy
A1Handle to relocatable block at whose end the copied data concatenated
A2Number of bytes to concatenate
Registers on exit
A0Handle to now-concatenated relocatable block
D0Result code

RESULT CODES
noErr0No error
memFullErr-108Not enough memory
nilHandleErr-109NIL master pointer
memWZErr-111Attempt to operate on a free block

Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996