The output for a sketch build I'm working on looks something like this:
Assuming I don't put anything else in RAM1, do I have pretty much all of that 170K available for the stack, meaning I can allocate a 16K, or larger buffer if needed?
The reason I'm asking is that I got a very rude surprise on an ESP8266 a day or two ago when I discovered that it has a hard cap of 4K on the stack size, irrespective of the actual free memory.
I'd much rather place buffers of this sort on the stack, because they really are transitory, when the routine they're created in returns, they're gone, no longer needed. This is obviously the best use of memory, since some other routine can recycle that memory for its buffers.
Code:
Memory Usage on Teensy 4.1:
FLASH: code:358444, data:48696, headers:8600 free for files:7710724
RAM1: variables:53952, code:279296, padding:15616 free for local variables:175424
RAM2: variables:91424 free for malloc/new:432864
Assuming I don't put anything else in RAM1, do I have pretty much all of that 170K available for the stack, meaning I can allocate a 16K, or larger buffer if needed?
The reason I'm asking is that I got a very rude surprise on an ESP8266 a day or two ago when I discovered that it has a hard cap of 4K on the stack size, irrespective of the actual free memory.
I'd much rather place buffers of this sort on the stack, because they really are transitory, when the routine they're created in returns, they're gone, no longer needed. This is obviously the best use of memory, since some other routine can recycle that memory for its buffers.