4.53 __user_heap_extent()

If defined, the __user_heap_extent() function returns the bounds of the memory available to the Heap2 allocator.

See rt_misc.h.

Syntax

extern __value_in_regs struct __heap_extent __user_heap_extent(unsigned ignore1, unsigned ignore2);

Usage

The parameters ignore1 and ignore2 are the default values for the base address and size of the heap. They are for information only and can be ignored.

You only need to implement this function if you are using the Heap2 allocator, which is also part of the C library. This function has no default implementation. The Heap2 allocator calls it during heap initialization to determine the maximum address range that the heap can occupy. The function returns the base address of the heap and the total number of bytes available to the heap, rounded up to the next power of two.

For example, if you want to specify that all your heap allocations will come from address 0x80000000 and above, and that the heap has a total maximum size of 3MiB, __user_heap_extent() should return base=0x80000000 and range=0x400000, which is 3MiB rounded up to the next power of two.

Non-ConfidentialPDF file icon PDF versionARM DUI0475M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.