IMPORTANT: This section describes the current (3.X) implementation of Palm OS memory architecture. This implementation may change as the Palm OS evolves. Do not rely on implementation-specific information described here; instead, always use the API provided to manipulate memory.
NOTE:  Starting with Palm OS 3.5, the dynamic heap is sized based on the amount of memory available to the system.
IMPORTANT: This section describes the current (3.X) implementation of Palm OS memory architecture. This implementation may change as the Palm OS evolves. Do not rely on implementation-specific information described here; instead, always use the API provided to manipulate memory.
NOTE:  In Palm OS 3.5, the dynamic heap is sized based on the amount of memory available to the system.
IMPORTANT: Expect the heap structure to change in the future. Use the API to work with heaps.
nextMstrPtrTable
field of the previous master pointer table. Any number of master pointer tables can be linked in this way. Because additional master pointer chunks are nonmovable, they are allocated at the end of the heap, according to the guidelines described in the "Heap chunks" section following immediately.
IMPORTANT: Expect the chunk structure to change in the future. Use the API to work with chunks.
hOffset
information.
sizeAdj
byte.This byte contains flags in the high nibble and a size adjustment in the low nibble.
IMPORTANT: Expect the local ID structure to change in the future. Use the API to work with chunks.
MemPtr
Xxx calls, including MemPtrSize, also work on pointers to locked, movable chunks.
NOTE:  You cannot allocate a zero-size chunk.
MemPtrSize.
To resize it, call MemPtrResize. You generally can't increase the size of a nonmovable chunk unless there is free space in the heap immediately following the chunk. When you no longer need the chunk, call MemPtrFree, which releases the chunk even if it's locked.
MemPtrFree
or MemHandleFree functions.
NOTE:  For important cautions and practical advice regarding the proper use of memory on Palm OS devices, be sure to read "Writing Robust Code" in the chapter "Good Design Practices" in this book.
NOTE:  Starting with PalmOS 3.5, the dynamic heap is sized based on the amount of memory available to the system. The size which will be used is as follows:
Memory Manager Functions | |
---|---|
Allocating and Freeing Memory | |
MemHandleNew MemHandleLock MemLocalIDToLockedPtr MemHandleFree |
MemPtrNew MemHandleUnlock MemPtrUnlock MemPtrFree |
Resizing Chunks | |
MemHandleResize MemPtrResize MemHeapFreeBytes |
MemHandleSize MemPtrSize MemHeapSize |
Working With Memory | |
MemMove MemCmp |
MemSet MemHeapCompact |
Converting Pointers | |
MemPtrRecoverHandle MemLocalIDKind MemPtrToLocalID |
MemHandleToLocalID MemLocalIDToGlobal MemLocalIDToPtr |
Chunk Information | |
MemHandleCardNo MemHandleHeapID MemPtrCardNo MemPtrSetOwner |
MemHandleDataStorage MemHandleSetOwner MemPtrDataStorage |
Heap Information | |
MemPtrHeapID MemHeapDynamic MemHeapFlags |
MemHeapID MemHeapCheck |
Card Information | |
MemCardInfo MemNumHeaps MemStoreInfo |
MemNumCards MemNumRAMHeaps |
Debugging | |
MemDebugMode MemSetDebugMode | MemHeapScramble |
  |   |