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 mprec_*tens arrays to PROGMEM #2

Conversation

earlephilhower
Copy link

This patch is related to esp8266/Arduino#3740 , increasing heap RAM on the ESP8266 by moving library constants into ROM.

There are several double[] arrays in mprec.c which can be moved to progmem
without any performance impact or code changes (doubles are 8-bytes, so
all accesses and alignments should be on 32-bit or even 64-bit boundaries).
strtod() also has the same (duplicated) tinytens array.
Saves about 280 bytes of RAM where these arrays appear.

There are several double[] arrays in mprec.c which can be moved to progmem
without any performance impact or code changes (doubles are 8-bytes, so
all accesses and alignments should be on 32-bit or even 64-bit boundaries).
strtod() also has the same (duplicated) tinytens array, also moved.
Saves about 280 bytes of RAM where these arrays appear.
@igrr
Copy link
Owner

igrr commented Jan 11, 2018

Looks good as well, just the header file thing mentioned in #4.

@earlephilhower
Copy link
Author

Closing in lieu of #5

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