1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

Move some exception strings to PROGMEM (#5050)

The memory allocation failure message was accidentally stored in RAM
and not in PROGMEM.

panic() did not place the __FILE__ string in PROGMEM, either.

Move both to PROGMEM, save ~64 bytes of heap (depends on size of path
of the Arduino core library).
This commit is contained in:
Earle F. Philhower, III 2018-08-16 08:15:02 -07:00 committed by GitHub
parent 831e75d79e
commit d96c8f393e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -166,7 +166,7 @@ void __wrap_system_restart_local() {
// Use cap-X formatting to ensure the standard EspExceptionDecoder doesn't match the address // Use cap-X formatting to ensure the standard EspExceptionDecoder doesn't match the address
if (umm_last_fail_alloc_addr) { if (umm_last_fail_alloc_addr) {
ets_printf("\nlast failed alloc call: %08X(%d)\n", (uint32_t)umm_last_fail_alloc_addr, umm_last_fail_alloc_size); ets_printf_P("\nlast failed alloc call: %08X(%d)\n", (uint32_t)umm_last_fail_alloc_addr, umm_last_fail_alloc_size);
} }
custom_crash_callback( &rst_info, sp + offset, stack_end ); custom_crash_callback( &rst_info, sp + offset, stack_end );

View File

@ -23,7 +23,7 @@ extern "C" {
#endif #endif
void __panic_func(const char* file, int line, const char* func) __attribute__((noreturn)); void __panic_func(const char* file, int line, const char* func) __attribute__((noreturn));
#define panic() __panic_func(__FILE__, __LINE__, __func__) #define panic() __panic_func(PSTR(__FILE__), __LINE__, __func__)
#ifdef __cplusplus #ifdef __cplusplus
} }