Not a bug report probably, but I'm curious about Teensy RAM ("dynamic memory") usage in Teensyduino.
When I compile the Blink example for the Arduino Mega 2560 under Arduino 1.8.8 and Teensyduino 1.45, I get this memory usage:
Sketch uses 1472 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 8183 bytes for local variables. Maximum is 8192 bytes.
When I compile the same example for Teensy 3.2, optimized for Smallest Code with LTO, I get this:
Sketch uses 6412 bytes (2%) of program storage space. Maximum is 262144 bytes.
Global variables use 2404 bytes (3%) of dynamic memory, leaving 63132 bytes for local variables. Maximum is 65536 bytes.
Why the huge difference in dynamic memory? What are those extra 2395 bytes doing? Run-time stack or something?
Is there a better way to write source code to reduce the RAM usage?
When I compile the Blink example for the Arduino Mega 2560 under Arduino 1.8.8 and Teensyduino 1.45, I get this memory usage:
Sketch uses 1472 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 8183 bytes for local variables. Maximum is 8192 bytes.
When I compile the same example for Teensy 3.2, optimized for Smallest Code with LTO, I get this:
Sketch uses 6412 bytes (2%) of program storage space. Maximum is 262144 bytes.
Global variables use 2404 bytes (3%) of dynamic memory, leaving 63132 bytes for local variables. Maximum is 65536 bytes.
Why the huge difference in dynamic memory? What are those extra 2395 bytes doing? Run-time stack or something?
Is there a better way to write source code to reduce the RAM usage?