1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

Move ASSERT() macro file text to PMEM (#3477)

Every assert() includes a __FILE__ constant string to RODATA which
can be quite large as it includes the complete path as well as
the filename.

Move that string into PMEM, and update the postmortem to work with
either PMEM or RAM strings for dumping abort/assert/exception
information.
This commit is contained in:
Earle F. Philhower, III
2017-08-01 08:37:26 -07:00
committed by Ivan Grokhotkov
parent f5b6e16474
commit a662e81146
2 changed files with 23 additions and 8 deletions

View File

@ -7,13 +7,14 @@ extern "C" {
#endif
#include "_ansi.h"
#include <pgmspace.h>
#undef assert
#ifdef NDEBUG /* required by ANSI standard */
# define assert(__e) ((void)0)
#else
# define assert(__e) ((__e) ? (void)0 : __assert_func (__FILE__, __LINE__, \
# define assert(__e) ((__e) ? (void)0 : __assert_func (PSTR(__FILE__), __LINE__, \
__ASSERT_FUNC, #__e))
# ifndef __ASSERT_FUNC