Closed ourairquality closed 6 years ago
I got no problem using this PR in my project. it allow to me 3.5k more heap.
The newlib patch was accepted upstream. There were only some minor documentation improvements. This patch seems a good 'next step', ahead of the icache/iram usage patch.
This change means that there is only one set of global stdin, stdout, and stderr FILE streams shared by all the threads. This reduces memory usage and avoids having to close these streams before threads exit. These streams still have a lock to synchronise access.
This was explored to address https://github.com/SuperHouse/esp-open-rtos/issues/564 but it seems to save a useful bit of memory too. Guess the stdio file stream memory usage adds up with a good number of threads.
This required adding support to newlib for this global stdio streams option when using the reent small option. Shall submit the change upstream for feedback there.
Testing and feedback welcomed.