Hi all, I am guessing if there is any way to have something similar to __rt_heap_extend of ARM RVCT (>=3.1) with GCC (Codesourcery version, that uses newlib implementation of libc).
How RVCT implementation of malloc works: once the heap is initialized, if there is no more space in the heap, a system call is performed to __rt_heap_extend. This hook has in input:
- in r0: minimum size requested;
- in r1: pointer to a pointer to a region that can be used as heap In output, it wants pointer pointed by r1 filled with the pointer to a region to be used as heap and in r0 the size of that region (that should be at least the min requested). If r0 is 0, the malloc will fail.
This is a sort of dynamic heap expansion.
Is there something similar available in GCC as well?
NOTE: the heap regions expanded with __rt_heap_extend are not necessarily adjacent to the current heap, so using _sbrk_r seems not possible.
--------------------------------------- Posted through