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

Commits on Dec 5, 2020

  1. Don't call init_signal in crt0.S

    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.
    Vogtinator committed Dec 5, 2020
    Configuration menu
    Copy the full SHA
    511e67a View commit details
    Browse the repository at this point in the history
  2. Explicitly free newlib's global data on exit

    - 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 committed Dec 5, 2020
    Configuration menu
    Copy the full SHA
    41a8d2c View commit details
    Browse the repository at this point in the history
  3. Call __gnu_cxx::__freeres() in _exit

    Like for newlib, libstdc++ also needs some code for cleaning up.
    Vogtinator committed Dec 5, 2020
    Configuration menu
    Copy the full SHA
    f435971 View commit details
    Browse the repository at this point in the history