This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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] Change _M_overflow to call _M_convert_to_external once


On Thu, May 15, 2003 at 05:58:06PM -0500, Benjamin Kosnik wrote:
> 
> >1- setbuf(s(!=null), n(==1)) is simply ignored. This is allowed
> >by the standard and not a big loss, probably, but still a change
> >of behavior.
> 
> I think this is the correct thing to do. This case is implementation
> defined behavior. I don't think this should be identical behavior wise
> to an unbuffered stream ("unbuffer this stream" as opposed "to use a new
> buffer that's very small").

That is rude.  The user has asked (if a bit confusedly) for minimum 
latency at the expense of throughput, and you've ignored that, even 
though the request is easy to satisfy.  If I'm not mistaken, this 
used to work in 2.x, so you've also broken code unnecessarily.

In fact, there's no real need to treat n==1 as a special case; if you
ignore it, then the user's buffer gets used only by overflow(), and
that's OK.

Nathan Myers
ncm-nospam@cantrip.org


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