Runtime Relocation of the Heap

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Runtime Relocation of the Heap

747 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by emh203 on Mon Apr 06 11:16:51 MST 2015
Is there a simple way of relocating start of the heap at runtime?
0 Kudos
Reply
2 Replies

733 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by emh203 on Thu Apr 09 10:26:04 MST 2015
Ok, thanks for the input.

I want to move the heap to external SDRAM on an LPC43xx *after* it is configured and a memcheck is performed in main.   I was hoping that noting actually uses dynamic memory before main.





0 Kudos
Reply

733 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu Apr 09 00:41:01 MST 2015
I have not tried this, but you ought to be able achieve this by setting __end_of_heap before the first call into the memory allocation function (malloc etc).

We might be able to provide more advice if you explain in more detail exactly what you are trying to do and why.

Note that if you are linking against the Redlib nohost or semihost library variants, this will need to be done in the reset handler before the call to __main() [as this initialisation function calls into the memory allocator].

PS - you might also want to scan through this recent thread:
http://www.lpcware.com/content/forum/check-heap-usage-runtime

Regards,
LPCXpresso Support
0 Kudos
Reply