Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move ASSERT() macro file text to PMEM #3477

Merged
merged 2 commits into from
Aug 1, 2017

Conversation

earlephilhower
Copy link
Collaborator

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

Move that string into PMEM, and update the postmortem to work with either PMEM or RAM strings for dumping abort/assert/exception information.

The amount of memory saved will vary depending on the number of asserts() in the code and the directory in which you build the tree, but on my own applications it saves around 300-500 bytes of additional RAM.

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.
@igrr igrr merged commit a662e81 into esp8266:master Aug 1, 2017
d-a-v pushed a commit to d-a-v/Arduino that referenced this pull request Sep 29, 2017
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.
@earlephilhower earlephilhower deleted the asserttopmem branch November 18, 2020 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants