Skip to content

Commit

Permalink
Move some exception strings to PROGMEM (#5050)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
earlephilhower authored Aug 16, 2018
1 parent 831e75d commit d96c8f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cores/esp8266/core_esp8266_postmortem.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void __wrap_system_restart_local() {

// Use cap-X formatting to ensure the standard EspExceptionDecoder doesn't match the address
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 );
Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern "C" {
#endif

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
}
Expand Down

0 comments on commit d96c8f3

Please sign in to comment.