| |||

Home > The C and C++ libraries > __user_heap_extend() |

Defined in `rt_misc.h`

, this function can
be defined to return extra blocks of memory, separate from the initial
one, to be used by the heap.

If defined, this function must return the size and base address of a heap extension block:

In AArch32 state, the heap extension block must be 8-byte aligned.

In AArch64 state, the heap extension block must be 16-byte aligned.

There is no default implementation of this function. If you define this function, it must have the following characteristics:

The returned size must be either:

A multiple of 8 bytes of at least the requested size in AArch32 state.

A multiple of 16 bytes of at least the requested size in AArch64 state.

0, denoting that the request cannot be honored.

Size is measured in bytes.

The function is subject only to

*ARM Architecture Procedure Call Standard*(AAPCS) constraints.The first argument is always zero on entry and can be ignored. The base is returned in the register holding this argument.

The returned base address must be aligned on:

An 8-byte boundary in AArch32 state.

A 16-byte boundary in AArch64 state.

This function places a pointer to a block of at least the
requested size in and
returns the size of the block.

`0`

`*base`

- Other information