This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Buffering in libstc++ 3.0
- To: libstdc++ at gcc dot gnu dot org
- Subject: Re: Buffering in libstc++ 3.0
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- Date: Wed, 29 Aug 2001 15:39:19 -0500 (CDT)
- Cc: simons at cryp dot to
- Organization: Networks and Infrastructure Lab (IL02/2240), Motorola Labs
In article <200108291722.f7THMMq15425@peti.cryp.to> you write:
> I have experienced some weird effects with g++ 3.0 and hope that you
> guys can explain to me what I am doing wrong. I compiled the program
>
> | #include <iostream>
> | using namespace std;
> |
> | int main(int argc, char** argv)
> | {
> | #ifdef NO_STDIO_SYNC
> | ios::sync_with_stdio(false);
> | #endif
> | #ifdef USE_MY_BUFFER
> | char buf[1*1024];
> | cin.rdbuf()->pubsetbuf(buf, sizeof(buf));
> | #endif
> |
> | string line;
> | for (getline(cin, line); cin; getline(cin, line))
> | ;
> |
> | return 0;
> | }
Hi Peter,
For systems that allow fseek() on interactive streams, the issue you
raise is fixed on the mainline and thus will be in the 3.1 release.
As this was a performance issue only, it was not moved to the branch.
If you want to play with this, feel free to move most/all of the
mainline differences in libstdc++-v3/src/ios.cc into your 3.0 source
tree.
Regards,
Loren
--
Loren J. Rittle
Senior Staff Software Engineer, Distributed Object Technology Lab
Networks and Infrastructure Research Lab (IL02/2240), Motorola Labs
rittle@rsch.comm.mot.com, KeyID: 2048/ADCE34A5, FDC0292446937F2A240BC07D42763672