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
MEMCreateUnitHeapEx. The following are options that can be specified.
|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.|
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.
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.
|Sets fill values.|
|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.
|Displays internal heap data.|
This feature obtains the start and end address of memory regions used by the heaps. The following functions accomplish this.
|Gets the starting address of the memory region used by the heap.|
|Gets the ending address + 1 of the memory region used by the heap.|
2013-05-08 Automated cleanup pass.
2010-11-01 Initial version.