This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [patch] New option --disable-reenterable-atexit
- From: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- To: newlib at sourceware dot org
- Date: Wed, 16 Oct 2013 10:34:33 +0200
- Subject: Re: [patch] New option --disable-reenterable-atexit
- Authentication-results: sourceware.org; auth=none
- References: <000001ceca3a$675f0f00$361d2d00$ at arm dot com>
On 2013-10-16 08:39, Joey Ye wrote:
There is an existing macro to declare atexit data structure as global
variables, so that it can be discarded if not used to save memory
consumption. But this macro was only enabled for certain targets.
This patch adds an configure option --disable-reenterable-atexit for more
targets.
ChangeLog:
2013-10-16 Joey Ye<joey.ye@arm.com>
configure.in (disable-reenterable-atexit): New option.
configure: Regenerated.
newlib.hin (_REENT_GLOBAL_ATEXIT): Place-holder.
README (disable-reenterable-atexit): Description for
new option.
reent_atexit-1010.patch
diff --git a/newlib/README b/newlib/README
index a8aba99..9b2d5b0 100644
--- a/newlib/README
+++ b/newlib/README
@@ -288,6 +288,12 @@ One feature can be enabled by specifying `--enable-FEATURE=yes' or
Disable dynamic allocation of atexit entries.
Most hosts and targets have it enabled in configure.host.
+`--disable-reenterable-atexit'
+ Disable reenterablility of atexit by declare related data structures
+ as global variables. By doing these data structures can be discarded
+ if atexit is not referenced.
+ Enabled by default.
I think the naming and the description is a bit misleading. The atexit()
support is not thread specific. Operations are serialized with the
__atexit_lock lock. In case _REENT_GLOBAL_ATEXIT is undefined, then the data
structures for the atexit() support are part of struct _reent, but only used in
_GLOBAL_REENT. Thus the space in the thread specific structures is wasted.
See also
https://sourceware.org/ml/newlib/2013/msg00355.html
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber@embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.