Forum Discussion
Altera_Forum
Honored Contributor
14 years ago --- Quote Start --- One problem is that the maximum stack use is likely to be in an obscure error path... If your code has no recursion, no calls to alloca() and no (or only identifyable) function pointers it is possible to determine the maximum stack use by analysing the object code. Parsing the output of gcc -S --fverbose-asm is possible the easiest source data. --- Quote End --- Thanks dsl. The "obscure error path" is certainly what I am trying to avoid, while at the same time getting the application to fit in available memory. I expect my final application will differ significantly from the SSS example, so I will have to monitor the stack usage to make sure I keep it large enough. This brings to mind another question or two about stack size assignment: can stack size be assigned on a per-task basis, with each task being assigned its unique stack size rather than use the global variable task_stacksize?
If this is possible, would your above prescribed method of analyzing the object code work for determining how much stack memory individual tasks are using?