Defined in rt_heap.h, the
__rt_heap_extend() function returns a new aligned block of memory to add to the heap, if possible.
If you reimplement
you must reimplement this function. An incomplete prototype implementation
is in rt_memory.s.
This function is not part of the C library standard, but the ARM® C library supports it as an extension.
The calling convention is ordinary AAPCS. On entry,
the minimum size of the block to add, and
a pointer to a location to store the base address.
The default implementation has the following characteristics:
- The returned size is one of the following:
- In AArch32 state, a multiple of 8 bytes of at least the requested size.
- In AArch64 state, a multiple of 16 bytes of at least the requested size.
- 0, denoting that the request cannot be honored.
- The returned base address is aligned on:
- In AArch32 state, an 8-byte boundary.
- In AArch64 state, a 16-byte boundary.
- Size is measured in bytes.
- The function is subject only to ARM Architecture Procedure Call Standard (AAPCS) constraints.
The default implementation extends the heap if there is sufficient
free heap memory. If it cannot, it calls
it is implemented. On exit,
r0 is the size of
the block acquired, or 0 if nothing could be obtained, and the memory
r1 pointed to on entry contains the base
address of the block.