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]New configuration option disable io vector buffer in Newlib



> -----Original Message-----
> From: newlib-owner@sourceware.org [mailto:newlib-owner@sourceware.org] On
> Behalf Of Corinna Vinschen
> Sent: Wednesday, March 27, 2013 5:05 PM
> To: newlib@sourceware.org
> Subject: Re: [PATCH newlib]New configuration option disable io vector buffer
> in Newlib
> 
> On Mar 27 15:20, Bin Cheng wrote:
> > > -----Original Message-----
> > > From: newlib-owner@sourceware.org
> > > [mailto:newlib-owner@sourceware.org] On Behalf Of Corinna Vinschen
> > > Sent: Tuesday, March 26, 2013 8:31 PM
> > > To: newlib@sourceware.org
> > > Subject: Re: [PATCH newlib]New configuration option disable io
> > > vector buffer in Newlib
> > >
> > > On Mar 26 18:13, Bin Cheng wrote:
> > > > Hi,
> > > > Stream IO functions in Newlib construct structures like
> > > > __suio/__siov, then call function __sfvwrite_r to do the buffered
> > > > IO. From the view of MCU programs, this layer code of vector
> > > > buffer occupies large amount flash and is generally unnecessary.
> > > > So here this patch introduces a new configuration time option
> > > > "--disable-newlib-fvwrite-in-streamio" allowing user to disable io
> > > > vector buffer in Newlib, thus reduces foot-print of stream-io and
> > > > formatted
> > > IO.
> > > > The default behavior won't be changed unless the option "--disbale-*"
> > > > is specified explicitly when configuring.
> > > > I tested it with some formatted IO tests and also passed the gcc
> > > > regression test. It has also been applied in the release of "GNU
> > > > Tools for ARM Embedded Processors" and used in many projects I believe.
> > > >
> > > > Is it OK or any suggestions?
> > >
> > > Your code looks pretty straightforward to me, so I don't see a
> > > reason not to apply it.  Except I don't understand your ChangeLog.
> > > What's the non-existing _FSEEK_OPTIMIZATION having to do with it?  Typo?
> >
> > Thanks for reviewing it. This is a typo, I have another patch for fseek
> optimization and I definitely mix them together.
> > Here is the right one:
> >
> > 2013-03-27  Bin Cheng  <...>
> > 	* acconfig.h (_FVWRITE_IN_STREAMIO): Undef
> > 	* newlib.hin (_FVWRITE_IN_STREAMIO): Undef
> > 	* configure.in (--disable-newlib-fvwrite-in-streamio): New option.
> > 	* configure: Regenerated.
> > 	* libc/stdio/fputs.c (_fputs_r): Use _FVWRITE_IN_STREAMIO to
> > 	control __sfvwrite_r.  Add alternative implementation.
> > 	* libc/stdio/fputws.c (_fputws_r): Ditto.
> > 	* libc/stdio/fwrite.c (_fwrite_r): Ditto.
> > 	* libc/stdio/puts.c (_puts_r): Ditto.
> > 	* libc/stdio/vfprintf.c (__ssputs_r, __sfputs_r): New function.
> > 	(_VFPRINTF_R): Use _FVWRITE_IN_STREAMIO to control vector buffer.
> > 	(__SPRINT): Use _FVWRITE_IN_STREAMIO to control macro definition.
> > 	* libc/stdio/vfwprintf.c (_VFWPRINTF_R): Use _FVWRITE_IN_STREAMIO
> > 	to control vector buffer.
> > 	(__SPRINT): Use _FVWRITE_IN_STREAMIO to control macro definition.
> 
> Thanks.  Please go ahead and check in.
> 
Could you help me check in this, I have no write access to Newlib yet.

Thanks very much.




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