public inbox for
 help / color / mirror / Atom feed
From: Patrick Bader <>
Subject: Increased RAM usage after upgrade to newlib 4.3.0
Date: Fri, 17 Feb 2023 20:10:55 +0100	[thread overview]
Message-ID: <> (raw)

Dear newlib group members,

I have just updated my firmware from newlib 4.2.0 to newlib 4.3.0 from 
the Arch Linux packages and found out that static memory consumption 
rose by about 300 bytes due to the standard input and output streams.
However, I am not using these streams, but am using dynamic memory, 
which is using the _reent struct internally.

As I found out, this struct is always populated with the global __sf 
file descriptors in the 4.3.0 version of newlib, which are about 300 
bytes in total.
The library is built with --enable-newlib-reent-small with the nano.spec 
and in the 4.2.0 version, _reent is initialized with some fake file 
descriptors: "__sf_fake_stdin,..." which are way smaller.
Those fake versions are missing in newlib 4.3.0 and the __sf descriptors 
are used always.

Is this intended behaviour or a regression? If it is intended, is there 
a way or some flag to get rid of the extra 300 bytes?
I also do not need all those functions to be reentrant, but found no 
compilation parameter to turn this off.

Thank you in advance for your help.


Patrick Bader

             reply	other threads:[~2023-02-17 19:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17 19:10 Patrick Bader [this message]
2023-02-23  6:02 ` Sebastian Huber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).