Eliminate Heap

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

Eliminate Heap

1,137 次查看
sebasira
Senior Contributor I

I'm working with MCF51QE128 and CW6.3

 

If I'm not using any dynamic memory allocation,  could I eliminate heap? I mean define heap size as 0x0000 so I can gain more RAM

 

Thanks in advance!

标签 (1)
0 项奖励
回复
3 回复数

886 次查看
CrasyCat
Specialist III

Hello

 

Yes this is possible defining a heap_size of 0 bytes should be supported.

 

CrasyCat

0 项奖励
回复

886 次查看
sebasira
Senior Contributor I

Thanks!

 

I was near my RAM limit, now I've got 1K more!

0 项奖励
回复

886 次查看
FridgeFreezer
Senior Contributor I

I have a similar question, I don't use malloc() but my heap is defined differently, can I just remove all references to __HEAP* from the .LCF?

 

   ___FLASH        = ADDR(.bootcode);    ___FLASH_SIZE    = 0x00080000;    ___SRAM            = 0x20000400;    ___SRAM_SIZE    = 0x0000FC00;    ___VECTOR_RAM    = 0x20000000;    ___IPSBAR        = ADDR(.ipsbar);    ___SP_SIZE      = 0x2000; # 8k    ___HEAP_START    = .; # Store after sections above (.bss)    ___HEAP_END        = ___SRAM + ___SRAM_SIZE - ___SP_SIZE;    ___SP_END        = ___HEAP_END;    ___SP_INIT        = ___SP_END + ___SP_SIZE;          ___heap_addr     = ___HEAP_START;    ___heap_size     = ___HEAP_END - ___HEAP_START ;    __SP_INIT         = ___SP_INIT;        # http://forums.freescale.com/freescale/attachments/freescale/CWCFCOMM/3435/1/TN268.pdf    ___mem_limit = ___HEAP_END;    ___stack_safety = 16;

 

0 项奖励
回复