Don't store stack size by default

Hey you revolutionary IoTlers,

René proposed some time ago [1] to omit the size field in the tcb by default in order to save some bytes. I think that's a good idea, but could imagine that someone might have a different opinion or does no one really care?

Cheers, Oleg


It's more likely to make a difference on the small platforms like the MSP430 than the larger ones like the STM32's.

I think early versions of Windows had such a feature. And would pop up a dialog box when you ran out of stack space. Then another, and so forth.

Once stack is depleated, it gets really hard to call nested subroutines to report the error, because you've no stack space to do that.

The best solution I've seen is to flash on/off the LED in a repeating loop at a prescribed rate. It's pretty obvious to most users that there is a serious problem and it doesn't generally require extra stack space to implement. Just a loop.



This reminds me of the endless battles with Linux’s out of memory killer.​

Hello David,

catching stack overflows is not the idea of tcp_t::stack_size. It is used so you can see the stack usage in the shell command "ps".

I deemed this feature little useful, so I proposed to omit the field, unless -DDEVEL_HELP is defined in the CFLAGS.

Cheers, René

+1 for Renes change.

Cheers, Hauke

In case the only use of this memory is to have a debugging tool working a little bit better:

  +1 for Renés proposal

Best Christian