Stack size for main using C code:
EdSeymore
Posts: 20
in Propeller 1
Q1. What is the stack size for main?
Q2. How can a program change the stack size for main?
Q3. Is there a utility app for determining stack usage for all active cogs?
Q2. How can a program change the stack size for main?
Q3. Is there a utility app for determining stack usage for all active cogs?
Comments
2. The primary stack size cannot be increased. It can be decreased by using malloc or calloc.
3. Stack usage can be checked by first prefilling the stack with a known value, and then later check for the value starting from the lowest address. This is fairly straightforward to do for the additional cogs. For the initial cog you must account for malloc'ed space, and take care not to overwrite current stack data when prefilling.