Other Parts Discussed in Thread: LAUNCHXL-CC26X2R1, CC2640R2L, SYSBIOS
Dear TI support,
I'm trying to minimize per thread stack and heap usage on my application, with the GNU GCC Linaro 9.2.1 toolchain
When using errno for the first time withing a thread, newlib allocates a dynamic buffer for the _reent struct of the thread (I'm not using any other reentrancy features, I think).
The dynamic memory allocation is a small problem I think I can live with, as hopefully it will only happen once per thread (my threads are all static).
The problem cames because the memory allocation procedure takes a bunch of stack usage, but the threads then do not need so much memory later on. I can minize this thread usage if I force an allocation on thread start (by setting errno to 0, for example) avoiding allocations later on within a nested funcion call, however, I still get stack usage of about 700 bytes per thread, while in the rest of the working scenarios the threads are using something in the 400 figure (if errno is never used, i.e: stdlib funcionts are all happy with external environment uncontrollable input like "strtoul")
I would like to know if there's a way to configure TI-RTOS to statically preallocate this structure for each thread, so no dynamic memory allocation is neccessary and both heap and stack usage can be reduced or removed.
Thank you