Please help me. I am stuck with this for more than a month.
Here are some content of a standard lcf file.
.custom :
{
___HEAP_START = .;
___heap_addr = ___HEAP_START;
___HEAP_END = ___HEAP_START + ___heap_size;
___SP_END = ___HEAP_END;
___SP_INIT = ___SP_END + ___stack_size;
___free_mem = ___SP_INIT;
. = ALIGN (0x4);
} >> userram
Where does RTOS/Compiler use this heap and stack ?
We are working with MCF520X mp.
Hello
The startup code is initializing the stack according to the value of __SP_INIT in file CF_startup.c.
The heap is allocated in alloc.c according to settings of ___heap_addr.
CF_Startup.c is stored in {Install}\ColdFire_Support\Runtime\Runtime_ColdFire\Source
alloc.c can be found in {Install}\ColdFire_Support\msl\MSL_C\MSL_Common\Src
CrasyCat
Let me explain my question.
Is it used for
a) Global variable
b) local variable
c) function calls
d) thread context switch
e) dynamic memory allocation
Consider that we are using some RTOS also.
Hello
Basically and this is a standard way of operation for an ANSI C compiler
- Heap is used for dynamic memory allocation
- stack is used for function calls, local variables and parameters.
CrasyCat