Shannon Roberts

Dynamic Memory Allocation on the HC08?

Discussion created by Shannon Roberts on Apr 11, 2006
Latest reply on Apr 12, 2006 by CrasyCat
Hello,
 
I'm using the GP32 and the CodeWarrior IDE, programming in C.  I know this device doesn't have all that much RAM (512 bytes), but I was hoping to use malloc() instead of a global variable for some small string parsing.  When I compile, I get an error that says, "Out of allocation space in segment RAM at address 0x104".  Using malloc() is no problem on devices that have more memory.  Just to confirm, I increased the RAM size in the .prm file and then the error went away.  It seems that CodeWarrior wants to allocate more RAM for the heap than the GP32 device even has.  Somewhere, there has to be a place that I can reduce the heap size, but I'm not finding it.  Has anyone done this before?
 
Thanks in advance.

Outcomes