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 A4C8C3836018 for ; Tue, 10 May 2022 08:09:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A4C8C3836018 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 sslproxy06.your-server.de ([78.46.172.3]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1noKw5-000Mpo-D5 for newlib@sourceware.org; Tue, 10 May 2022 10:09:37 +0200 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy06.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1noKw5-000GyX-HQ for newlib@sourceware.org; Tue, 10 May 2022 10:09:37 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 3BD9048015F for ; Tue, 10 May 2022 10:09:37 +0200 (CEST) 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 kVGmAVONCOec; Tue, 10 May 2022 10:09:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id D71C54800B0; Tue, 10 May 2022 10:09:36 +0200 (CEST) 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 JImo08P9yZwX; Tue, 10 May 2022 10:09:36 +0200 (CEST) Received: from joyce-tux.eb.localhost (unknown [10.10.171.30]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 6360D480024; Tue, 10 May 2022 10:09:36 +0200 (CEST) From: Matthew Joyce To: newlib@sourceware.org Subject: [PATCH 00/11] Decouple global file object list from _GLOBAL_REENT Date: Tue, 10 May 2022 10:09:16 +0200 Message-Id: <20220510080927.28839-1-matthew.joyce@embedded-brains.de> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: smtp-embedded@poldinet.de X-Virus-Scanned: Clear (ClamAV 0.103.5/26536/Mon May 9 10:04:57 2022) X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2022 08:09:41 -0000 From: Matt Joyce The _GLOBAL_REENT structure maintains global information across threads, including a global list of open file objects. This patch set aims to decouple the global file object list from _GLOBAL_REENT, reducing depende= ncy on the structure. This is accomplished by: 1) Simplifying stdio and __sglue initializations 2) Adding a dedicated stdio atexit handler 3) Adding a global __sglue object and removing __sglue from struct _reent= for certain configurations This effort will facilitate the future addition of a thread-local storage configuration option as an alternative to using struct _reent. Matt Joyce (9): Remove duplicate stdio initializations Remove duplicate sglue initializations Add two __sglue initialization macros Remove __sinit_locks / __sinit_recursive_mutex Move __sglue initializations to __sfp() Add CLEANUP_FILE define Add stdio atexit handler Add global __sglue object for all configurations Remove __sglue member for one configuration Sebastian Huber (2): Declare global __sf[] only once stdio: Replace _fwalk_reent() with _fwalk_sglue() newlib/libc/include/sys/reent.h | 21 ++++-- newlib/libc/reent/reent.c | 6 +- newlib/libc/stdio/fcloseall.c | 9 ++- newlib/libc/stdio/fflush.c | 2 +- newlib/libc/stdio/findfp.c | 112 +++++++++++++++++--------------- newlib/libc/stdio/fwalk.c | 15 +++-- newlib/libc/stdio/local.h | 6 +- newlib/libc/stdio/refill.c | 4 +- newlib/libc/stdlib/exit.c | 6 +- winsup/cygwin/signal.cc | 5 +- winsup/cygwin/syscalls.cc | 5 +- 11 files changed, 110 insertions(+), 81 deletions(-) --=20 2.31.1