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

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

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

Jump to solution
1,448 Views
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
Labels (1)
Tags (1)
0 Kudos
1 Solution
534 Views
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
 

View solution in original post

0 Kudos
1 Reply
535 Views
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 Kudos