Runtime Relocation of the Heap

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Runtime Relocation of the Heap

753 次查看
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 项奖励
回复
2 回复数

739 次查看
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 项奖励
回复

739 次查看
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 项奖励
回复