RFA: Reducing the size of struct _reent by not supporting on_exit()

Michael Meissner newlib@the-meissners.org
Thu May 29 22:39:00 GMT 2003


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



More information about the Newlib mailing list