Important: The information in this document is obsolete and should not be used for new development.
Memory Manager Routines
This section describes the routines provided by the Memory Manager. You can use these routines to set up your application's partition, allocate and dispose of relocatable and nonrelocatable blocks, manipulate those blocks, assess the availability of memory in your application's heap, free memory from the heap, and install a grow-zone function for your heap. The Memory Manager also provides routines that allow you to allocate temporary memory and manipulate heap zones.
You cannot call most Memory Manager routines at interrupt time for several reasons. You cannot allocate memory at interrupt time because the Memory Manager might already be handling a memory-allocation request and the heap might be in an inconsistent state. More generally, you cannot call at interrupt time any Memory Manager routine that returns its result code via the
- Note
- The result codes listed for Memory Manager routines are usually not directly returned to your application. You need to call the
MemError
function (or, from assembly language, inspect theMemErr
global variable) to get a routine's result code.MemError
function, even if that routine doesn't allocate or move memory. Resetting theMemErr
global variable at interrupt time can lead to unexpected results if the interrupted code depends on the value ofMemErr
. Note that Memory Manager routines likeHLock
return their results viaMemError
and therefore should not be called in interrupt code.
Subtopics
- Setting Up the Application Heap
- Allocating and Releasing Relocatable Blocks of Memory
- Allocating and Releasing Nonrelocatable Blocks of Memory
- Changing the Sizes of Relocatable and Nonrelocatable Blocks
- Setting the Properties of Relocatable Blocks
- Managing Relocatable Blocks
- Manipulating Blocks of Memory
- Assessing Memory Conditions
- Freeing Memory
- Grow-Zone Operations
- Allocating Temporary Memory
- Accessing Heap Zones
- Manipulating Heap Zones