Description
An option to use "-DNDEBUG" should be added to all boards.txt debug levels to disable ASSERT macros (and save the string memory they use).
I sent in a merged pull request that takes the constant string of the filename in the assert() macro and moves them to PROGMEM. Unfortunately, the same can not be done with the function name part of the macro, PRETTY_FUNCTION, because it is defined as a char* by GCC and added to the function locals a "static const char[]="xxxx";" In a nutshell, you can't convert that to PROGMEM w/o changing GCC internals. (See https://stackoverflow.com/questions/4384765/whats-the-difference-between-pretty-function-function-func for more info)
In some cases, like ESP8266WiFiClient, those PRETTY_FUNCTION strings can take 100s of bytes due to C++ template expansion. My ESP8266 WebRadio sketch has ~500 bytes of template expansion strings stuck in RAM in .rodata because of this. That's a significant amount of total usable RAM for me and others pushing the ESP8266's capabilities.
In boards.txt the change would look like:
- *.menu.DebugLevel.NDEBUG=NDEBUG
- *.menu.DebugLevel.NDEBUG.build.debug.level = -DNDEBUG
@d-a-v - I'd submit a patch myself, but I see some stuff about generating boards.txt from a python script in the file, but the referenced generator doesn't seem to be there. If there's some other repo I should look at and submit a PR, just point me in the right direction.
Thx
-EFP3