[PATCH Newlib]Introducing new config option to disable optimization on unbuffered unix stream file
Bin Cheng
bin.cheng@arm.com
Mon Jun 17 02:12:00 GMT 2013
> -----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.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: unbuf-stream-opt-20130617.txt
URL: <http://sourceware.org/pipermail/newlib/attachments/20130617/ca003094/attachment.txt>
More information about the Newlib
mailing list