This is the mail archive of the newlib@sourceware.org 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: [PATCH Newlib]Introducing new config option to disable optimization on unbuffered unix stream file



> -----Original Message-----
> From: Howland Craig D (Craig) [mailto:howland@lgsinnovations.com]
> Sent: Friday, June 14, 2013 10:53 PM
> To: Bin Cheng; newlib@sourceware.org
> Subject: RE: [PATCH Newlib]Introducing new config option to disable
> optimization on unbuffered unix stream file
> 
> -----Original Message-----
> >From: newlib-owner@sourceware.org [mailto:newlib-owner@sourceware.org]
> On >>>>Behalf Of Bin Cheng
> >Sent: Friday, June 14, 2013 12:42 AM
> >To: newlib@sourceware.org
> >Subject: [PATCH Newlib]Introducing new config option to disable
> optimization on >unbuffered unix stream file
> >
> >Hi,
> >
> >For now newlib vfprintf_r calls __sbprintf doing optimization on
> unbuffered
> >unix stream file. This brings about 120 bytes overhead for text and 1KB
> for
> >stack consumption for fprintf(stderr, ...) This patch introduces option
> >"--disable-newlib-unbuf-opt" to allow end
> user
> >to disable the optimization and it doesn't change the default behavior.
> >...
> >bin
> 
> I suggest that #ifdef _UNBUF_STREAM_OPT should be added to the
> __sbprintf() and __sbwprintf() definitions in vfprintf.c and vfwprintf.c,
too,
> as that will eliminate those otherwise-unused functions, reducing text
even
> further.  (737 bytes is saved for vfprintf, in a quick trial compile on
i686.)
> 
Thanks for review.  Here attached the new version.

Thanks.
bin

2013-06-17  Bin Cheng  <bin.cheng@arm.com>

	* acconfig.h (_UNBUF_STREAM_OPT): Undef
	* newlib.hin (_UNBUF_STREAM_OPT): Undef
	* configure.in (--enable-newlib-unbuf-stream-opt): New option.
	* configure: Regenerated.
	* libc/stdio/vfprintf.c (_VFPRINTF_R): Don't do optimization on
	unbuffered stream files.
	* libc/stdio/vfwprintf.c (_VFWPRINTF_R): Likewise.
	* README: Add description about the option.

Attachment: unbuf-stream-opt-20130617.txt
Description: Text document


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