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


HandAndHand

Use the HandAndHand function to concatenate two relocatable blocks.

FUNCTION HandAndHand (aHndl, bHndl: Handle): OSErr;
aHndl
A handle to the first relocatable block, whose contents do not change but are concatenated to the end of the second relocatable block.
bHndl
A handle to the second relocatable block, whose size the Memory Manager expands so that it can concatenate the information from aHndl to the end of the contents of this block.
DESCRIPTION
The HandAndHand function concatenates the information from the relocatable block to which aHndl is a handle onto the end of the relocatable block to which bHndl is a handle. The aHndl variable remains unchanged.

WARNING
The HandAndHand function dereferences the handle aHndl. You must call the HLock procedure to lock the block before calling HandAndHand. Afterward, you can call the HUnlock procedure to unlock it. Alternatively, you can save the block's original state by calling the HGetState function, lock the block by calling HLock, and then restore the original settings by calling HSetState.
SPECIAL CONSIDERATIONS
Because HandAndHand moves memory, you should not call it at interrupt time.

ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit for HandAndHand are
Registers on entry
A0Handle to be concatenated
A1Handle to contain itself, data from A0's handle
Registers on exit
A0Handle to concatenated data
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