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 / Managing Relocatable Blocks


HLockHi

You can use the HLockHi procedure to move a relocatable block to the top of the heap and lock it.

PROCEDURE HLockHi (h: Handle);
h
A handle to a relocatable block.
DESCRIPTION
The HLockHi procedure attempts to move the relocatable block referenced by the handle h upward until it reaches a nonrelocatable block, a locked relocatable block, or the top of the heap. Then HLockHi locks the block.

The HLockHi procedure is simply a convenient replacement for the pair of procedures MoveHHi and HLock.

SPECIAL CONSIDERATIONS
Because the HLockHi procedure moves memory, you should not call it at interrupt time.

Don't call HLockHi on blocks in the system heap. Don't call HLockHi from a desk accessory.

ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit for HLockHi are
Registers on entry
A0Handle to move and lock
Registers on exit
D0Result code

RESULT CODES
noErr0No error
nilHandleErr-109NIL master pointer
memWZErr-111Attempt to operate on a free block
memLockedErr-117Block is locked

Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996