PATCH: Avoid excessive flushing on lower-layer handle

Loren James Rittle rittle@latour.rsch.comm.mot.com
Tue Apr 23 14:57:00 GMT 2002


In article <wvlg01majut.fsf@prospero.cambridge.redhat.com>,
Jason Merrill <jason@redhat.com> writes:

[...]
>> + 	else
>> + 	  _M_file.sync();

> Shouldn't this be unconditional?  i.e. drop the "else"?

If we change the behavior of _M_really_overflow and callers of
_M_really_overflow, then it should be unconditional.

[...]
>> ! 	  else if (!_M_file.sync())
[...]

> Why do we need an fflush here at all?

Because callers of _M_really_overflow(eof) expect to learn of flush
failures immediately.

>> If the user must now flush to switch modes, this should always be a safe
>> optimization.

> My patch didn't change that; that will be a later, trunk-only patch.  But I
> think your change is still safe.

Based on your questions, you seem to desire the more extensive patch
to change callers of _M_really_overflow().

I will post it for comment.

Regards,
Loren



More information about the Libstdc++ mailing list