[Patch] Change _M_overflow to call _M_convert_to_external once

Nathan Myers ncm-nospam@cantrip.org
Fri May 16 01:47:00 GMT 2003


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



More information about the Libstdc++ mailing list