This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: libstdc++/4150: catastrophic performance decrease in C++ code
>>>>> "Nathan" == Nathan Myers <ncm-nospam@cantrip.org> writes:
> On Thu, Apr 18, 2002 at 03:18:17AM +0100, Jason Merrill wrote:
>> >>>>> "Jason" == Jason Merrill <jason@redhat.com> writes:
>>
>> ... how often do people
>> really read a few characters, write a few characters, and then read a few
>> more characters without an intervening seek?
>>
>> A problem with the current implementation of this is that if we do a read
>> on an input/output filebuf, we end up writing the contents of the buffer
>> back out to the file, even if we've never requested a write. Oops.
> Not only that, it's undefined behavior to switch between reading
> and writing without a seek between.
Well, then we shouldn't do that in filebuf_virtuals.cc...
c1 = fb_03.snextc(); //current in pointer +1
VERIFY( c1 == '7' );
c2 = fb_03.sputc('x'); //test current out pointer
c3 = fb_03.sputc('\n');
c1 = fb_03.sgetc();
Also, I can't find this in the standard. Care to point me at a reference?
Jason