Author Topic: OUR_HEAP_SIZE increments  (Read 6514 times)

Offline alager

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
OUR_HEAP_SIZE increments
« on: July 12, 2010, 10:00:07 PM »
Mark,

My project has run to the limits of the chip I'm using, and I ran out of stack space.  After a lot of squeezing here and there, I changed the OUR_HEAP_SIZE define.
Code: [Select]
#define OUR_HEAP_SIZE (HEAP_REQUIREMENTS)((22*1024)*MEM_FACTOR)
to
Code: [Select]
#define OUR_HEAP_SIZE (HEAP_REQUIREMENTS)((43*512)*MEM_FACTOR)

I don't know enough about the memory structure to know if this is an issue or not.  Things seem to be working for now.
HEAP   Free 0x0194 from 0x5600
STACK   Unused 0x00d7
Prior to the heap change, I had no stack left. 

What are your thoughts on changing from 1024 to 512? 
Thanks,
Aaron

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: OUR_HEAP_SIZE increments
« Reply #1 on: July 13, 2010, 02:23:22 AM »
Hi Aaron

You are certainly quite close to the RAM limits (from the results you have 404 free bytes on heap which may be able to be given for stack use).

(43 * 512) is the same as (21.5 * 1024). The * 1024 is used so that the first figure represents kBytes - also (21.423 * 1024), etc.  would be OK if you prefer to think in kBytes. The value is first calculated by the compiler as a float value and then rounded to nearest integer.

Regards

Mark