So, if my code doesn’t use standard malloc() or call a library function
which calls malloc(), I can set heap size to 0, right?
Make sure that
is not being called indirectly, e.g. by localtime(). You can catch this by defining a
function which calls some undefined function:
extern void* mallocis
beingcalled( void );
void* malloc (size
/* Call an undefined function to provoke a linker error. */
Some people define a task-safe version of
And for the stack size, …, the dedicated interrupt stack is part of
stack that is specified in the linker script.
True. When your application starts up, the stack from the linker-script is being used to store local variables and to call functions. Interrupts are disabled until
is called. At that moment, the interrupts may use the stack space and every task has its own stack.