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

Some newlib-related optimizations #263

Merged
merged 3 commits into from
Jan 23, 2021

Conversation

Vogtinator
Copy link
Contributor

Smaller binaries, less memory leaks.

This avoids two issues:
- init_signal unconditionally pulls in and calls malloc,
  even if signals aren't used
- The allocated memory is (intentionally) never freed

It appears like functions depending on init_signal call it themselves if it
wasn't done previously, so this avoids both issues, as long as signal functions
aren't used in the program.
- Without this, memory allocated by e.g. dtoa would not get freed
- Have to set _impure_ptr to NULL to avoid if(ptr == _inpure_ptr) return;
  in _reclaim_reent
@Vogtinator Vogtinator mentioned this pull request Dec 5, 2020
Like for newlib, libstdc++ also needs some code for cleaning up.
@Vogtinator Vogtinator merged commit 7785949 into ndless-nspire:master Jan 23, 2021
@Vogtinator Vogtinator deleted the newliboptimization branch January 23, 2021 12:33
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.

None yet

1 participant