From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id B8C943858D33 for ; Thu, 23 Feb 2023 06:02:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B8C943858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de Received: from sslproxy04.your-server.de ([78.46.152.42]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pV4gw-0003tX-Od; Thu, 23 Feb 2023 07:02:54 +0100 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy04.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pV4gw-000Nd7-7V; Thu, 23 Feb 2023 07:02:54 +0100 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id D9B15480048; Thu, 23 Feb 2023 07:02:53 +0100 (CET) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id XOZ1tfHJRbcM; Thu, 23 Feb 2023 07:02:53 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 82F71480167; Thu, 23 Feb 2023 07:02:53 +0100 (CET) X-Virus-Scanned: amavisd-new at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id FBxOCN8oU6xI; Thu, 23 Feb 2023 07:02:53 +0100 (CET) Received: from [10.10.171.6] (unknown [10.10.171.6]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 4B9F7480048; Thu, 23 Feb 2023 07:02:53 +0100 (CET) Message-ID: Date: Thu, 23 Feb 2023 07:02:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: Increased RAM usage after upgrade to newlib 4.3.0 Content-Language: en-US To: Patrick Bader , newlib@sourceware.org References: <9c0c090d-87fc-9f71-40f2-dd92c10cf6b8@patrickbader.eu> From: Sebastian Huber In-Reply-To: <9c0c090d-87fc-9f71-40f2-dd92c10cf6b8@patrickbader.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: smtp-embedded@poldi-networks.de X-Virus-Scanned: Clear (ClamAV 0.103.8/26820/Wed Feb 22 09:30:58 2023) X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,KAM_NUMSUBJECT,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello Patrick, On 17.02.23 20:10, Patrick Bader wrote: > Dear newlib group members, >=20 > I have just updated my firmware from newlib 4.2.0 to newlib 4.3.0 from=20 > the Arch Linux packages and found out that static memory consumption=20 > 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,=20 > which is using the _reent struct internally. >=20 > As I found out, this struct is always populated with the global __sf=20 > file descriptors in the 4.3.0 version of newlib, which are about 300=20 > bytes in total. > The library is built with --enable-newlib-reent-small with the nano.spe= c=20 > and in the 4.2.0 version, _reent is initialized with some fake file=20 > descriptors: "__sf_fake_stdin,..." which are way smaller. > Those fake versions are missing in newlib 4.3.0 and the __sf descriptor= s=20 > are used always. >=20 > Is this intended behaviour or a regression? If it is intended, is there= =20 > 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=20 > compilation parameter to turn this off. this regression is probably a side-effect of the support for splitting=20 up the struct _reent into individual thread-local storage objects. See=20 the --enable-newlib-reent-thread-local configuration option. --=20 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=C3=BCnchen Registernummer: HRB 157899 Vertretungsberechtigte Gesch=C3=A4ftsf=C3=BChrer: Peter Rasmussen, Thomas= D=C3=B6rfler Unsere Datenschutzerkl=C3=A4rung finden Sie hier: https://embedded-brains.de/datenschutzerklaerung/