public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* Increased RAM usage after upgrade to newlib 4.3.0
@ 2023-02-17 19:10 Patrick Bader
  2023-02-23  6:02 ` Sebastian Huber
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick Bader @ 2023-02-17 19:10 UTC (permalink / raw)
  To: newlib

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.

Best,

Patrick Bader


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Increased RAM usage after upgrade to newlib 4.3.0
  2023-02-17 19:10 Increased RAM usage after upgrade to newlib 4.3.0 Patrick Bader
@ 2023-02-23  6:02 ` Sebastian Huber
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Huber @ 2023-02-23  6:02 UTC (permalink / raw)
  To: Patrick Bader, newlib

Hello Patrick,

On 17.02.23 20:10, Patrick Bader wrote:
> 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.

this regression is probably a side-effect of the support for splitting 
up the struct _reent into individual thread-local storage objects. See 
the --enable-newlib-reent-thread-local configuration option.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-23  6:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-17 19:10 Increased RAM usage after upgrade to newlib 4.3.0 Patrick Bader
2023-02-23  6:02 ` Sebastian Huber

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).