This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]