This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: RFA: Reducing the size of struct _reent by not supporting on_exit()
- From: Michael Meissner <newlib at the-meissners dot org>
- To: newlib at sources dot redhat dot com
- Date: Thu, 29 May 2003 08:50:33 -0400
- Subject: Re: RFA: Reducing the size of struct _reent by not supporting on_exit()
- References: <m3y90q13ac.fsf@redhat.com>
On Thu, May 29, 2003 at 10:59:55AM +0100, Nick Clifton wrote:
> Hi Jeff,
>
> May I apply the patch below please ?
>
> It adds a support for a new define which can be enabled in
> libc/include/sys/config.h. This define suppresses support for the
> on_exit() function, which can significantly reduce the size of the
> _reent structure. This is important for targets with a small
> address space (eg the xstormy16). The patch also uses the GCC
> poison pragma to stop user applications from using on_exit() if this
> define has been enabled.
I would think a better tack would be a macro that changes the _fns from being:
void (*_fns[_ATEXIT_SIZE])(void); /* the table itself */
to:
void **_fns; /* the table itself */
and then allocate it if the user ever needed on_exit functionality. Obviously
you would have to check whether it was allocated or not.
--
Michael Meissner
email: gnu@the-meissners.org
http://www.the-meissners.org