This section describes the functionality common among the expanded, frame, and unit heap.
Among the functions that can be used to create a heap, heap options can be specified using MEMCreateExpHeapEx, MEMCreateFrmHeapEx and MEMCreateUnitHeapEx. The following are options that can be specified.
| Flag | Content |
| The allocated memory block is filled with zeroes upon allocation from the heap. |
|---|---|
| When a heap is created and memory blocks are allocated and deallocated, this fills the memory regions respectively with different 32-bit values. |
| Enables exclusive processing between threads. |
The MEM_HEAP_OPT_DEBUG_FILL flag is used for debugging. Use this flag to find memory access bugs by tracing the pointer that points to the memory initialization failure or invalid memory regions. This flag will not function in the final ROM (FINALROM) version of the library. The following values fill in memory regions by default. See the next section to learn how to change these values.
0xC3C3C3C3
0xF3F3F3F3
0xD3D3D3D3
By specifying the MEM_HEAP_OPT_DEBUG_FILL flag when creating the heap, the memory region can be filled with a different 32-bit value during heap creation, memory block allocation and deallocation, respectively. This fill value can be modified. You can set and get the fill values using the following functions.
| Functions | Features |
MEMSetFillValForHeap | Sets fill values. |
|---|---|
MEMGetFillValForHeap | Gets fill values. |
Different values can be set when heaps are created, memory blocks are allocated, and memory blocks are freed. When you set or get values, the heap operation the values are specific to is set. The following table shows the types of heap operations specified in the function.
| Value Specified in the Function | Heap Operation |
| At heap creation. |
|---|---|
| At memory block allocation. |
| At memory block freeing. |
This feature for displaying the content of the heap is for debugging. The following functions accomplish this.
| Functions | Features |
MEMDumpHeap | Displays internal heap data. |
|---|
This feature obtains the start and end address of memory regions used by the heaps. The following functions accomplish this.
| Functions | Features |
MEMGetHeapStartAddress | Gets the starting address of the memory region used by the heap. |
|---|---|
MEMGetHeapEndAddress | Gets the ending address + 1 of the memory region used by the heap. |
2006/03/01 Initial version.
CONFIDENTIAL