How do I use malloc in HCS(08) CW?

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

How do I use malloc in HCS(08) CW?

跳至解决方案
1,942 次查看
PhilG
Contributor I
Hi,
I have set up a new project in CW for HCS(08). When I use malloc(60) it appears to want allocate all the RAM to the project. How do I manage the heap allocation in the linker etc. This does not appear to be set up in the project wizard?
Regards
Phil Green
标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,028 次查看
CrasyCat
Specialist III
Hello
 
The heap size is per default 2000 bytes.
If you want to use a smaller heap:
 - Open project hc08_lib.mcp from {Install}\lib\hc08c directory
 - Edit file libdefs.h (from {Install}lib\hc08c\include directory
 - Change the LIBDEF_HEAPSIZE to something smaller
 - save the changes
  - Rebuild the libraries (or at least the one you need.
 
This should do it :smileywink:.
 
CrasyCat
 

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,029 次查看
CrasyCat
Specialist III
Hello
 
The heap size is per default 2000 bytes.
If you want to use a smaller heap:
 - Open project hc08_lib.mcp from {Install}\lib\hc08c directory
 - Edit file libdefs.h (from {Install}lib\hc08c\include directory
 - Change the LIBDEF_HEAPSIZE to something smaller
 - save the changes
  - Rebuild the libraries (or at least the one you need.
 
This should do it :smileywink:.
 
CrasyCat
 
0 项奖励
回复