Stack or Heap or something else

dercmdr wrote on Wednesday, April 25, 2007:

Hi!

I want to use a char[2000] in a task. Now I am wondering if I have to set the stack size or the heap size +2000, so there are no memory problems.

Another question: Is there a possibility to see the heap address?

Thx!

rtel wrote on Wednesday, April 25, 2007:

If you really need the array to be on the stack then the stack size will have to be increased to accommodate it.  If only one task is going to access the array, or there is some sort of mutual exclusion mechanism to ensure consistent access, then the array can be declared static - which will prevent it being allocated on the stack.

Regards.

dercmdr wrote on Wednesday, April 25, 2007:

Thx for your answer. I am now using the array as a global array in a task which means it does not occupy stack or heap space, so everything should be fine.