Keil Logo


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.


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


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 DUI0378H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.