[patch] New option --disable-reenterable-atexit
Sebastian Huber
sebastian.huber@embedded-brains.de
Wed Oct 16 08:34:00 GMT 2013
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.
More information about the Newlib
mailing list