| |||||||||||||
Technical Support On-Line Manuals RealView Libraries and Floating Point Support Guide | Support for malloc
The default implementations of Heap1, the default implementation, implements the smallest and simplest heap manager. The heap is managed as a singly‑linked list of free blocks held in increasing address order. The allocation policy is first‑fit by address. This implementation has low overheads, but the cost of Heap2 provides a compact implementation with the cost of Heap2 is recommended when you require near constant‑time performance in the presence of hundreds of free blocks. To select the alternative standard implementation, use either:
The Heap2 real‑time heap implementation must know the maximum address space the heap spans. The smaller the address range, the more efficient the algorithm is. By default, the heap extent is taken to be 16MB starting at the beginning of the heap (defined as the start of the first chunk of memory given to the heap manager by The heap bounds are given by: struct __heap_extent { unsigned base, range; }; __value_in_regs struct __heap_extent __user_heap_extent( unsigned defaultbase, unsigned defaultsize); The function prototype for The Heap1 algorithm does not require the bounds on the heap extent, therefore it never calls this function. You must redefine
If you know in advance that the address space bounds of your heap are small, you do not have to redefine The input parameters are the default values that are used if this routine is not defined. You can, for example, leave the default base value unchanged and only adjust the size. NoteThe size field returned must be a power of two. The library does not check this and fails in unexpected ways if this requirement is not met. If you return a size of zero, the extent of the heap is set to 4GB. To use a heap implementation in an application that does not define
| ||||||||||||
| |||||||||||||