Heapmovehigh - Texas Instruments TI-89 Developer's Manual

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

Appendix A: System Routines — Memory Management

HeapMoveHigh

Declaration:
HANDLE HeapMoveHigh (HANDLE handle )
Category(ies):
Memory Management
Description:
Try to reallocate a block of heap memory as high in memory as possible.
The block must not be locked. Use HeapAllocHigh if a block must be
allocated high in memory when it is first allocated. HeapMoveHigh moves
an existing block of memory to high memory. Blocks of memory that are
locked for long periods of time should be moved high in memory so that
they do not interfere as much with the rest of the system.
Inputs:
None
If successful, handle is returned. If the block cannot be moved then
Outputs:
H_NULL is returned (the block is still in the same place as before, so no
memory is lost).
Assumptions:
None
Side Effects:
Will cause heap compression.
Availability:
All versions of the TI-89 / TI-92 Plus.
TI-89 / TI-92 Plus
Differences:
None
See Also:
HeapAlloc, HeapAllocThrow
Example:
HANDLE hBlock;
void *vPtr;
if (hBlock = HeapAllocThrow(1000)) {
/* . . . use hBlock . . . */
Now if we need to keep a locked version around, move it high in memory
and lock it.
*/
HeapMoveHigh( hBlock );
vPtr = HLock( hBlock );
/* . . . vPtr can now be used even if the heap is compressed . . .*/
return( hBlock );
}
TI-89 / TI-92 Plus Developer Guide
/* LOCK and dereference block */
/* in this case, caller will free the block */
Not for Distribution
857
Beta Version January 26, 2001

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-92 plus

Table of Contents