diff options
author | Jason Merrill <jason@redhat.com> | 2002-04-22 16:28:05 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2002-04-22 16:28:05 -0400 |
commit | 5066927d9ebedf0098887901674e576413312848 (patch) | |
tree | a33a1f81577d6fbf44ec2eca41aa87ca71f31743 /libstdc++-v3/src/ios.cc | |
parent | f942d7a5df511c42fe0af6edb0138bd806684561 (diff) | |
download | gcc-5066927d9ebedf0098887901674e576413312848.tar.gz |
re PR libstdc++/4150 (catastrophic performance decrease in C++ code)
PR libstdc++/4150
* include/std/std_streambuf.h (basic_streambuf::_M_set_indeterminate):
Move to filebuf.
(basic_streambuf::_M_set_determinate): Likewise.
(basic_streambuf::_M_is_indeterminate): Likewise.
* include/bits/std_fstream.h (basic_filebuf::_M_filepos): New
non-static data member.
(basic_filebuf::_M_underflow_common): New non-static member function.
(basic_filebuf::_M_underflow, _M_uflow): Call it.
(basic_filebuf::sync): Avoid useless seeking.
(basic_filebuf::_M_set_indeterminate): Move here from streambuf.
Set _M_filepos.
(basic_filebuf::_M_set_determinate): Likewise.
(basic_filebuf::_M_is_indeterminate): Likewise.
* include/bits/fstream.tcc (basic_filebuf::_M_really_overflow): Seek
back to _M_out_beg if necessary.
(basic_filebuf::seekoff): Likewise.
(basic_filebuf::_M_underflow_common): Generalization of old
underflow(). Don't seek back to _M_in_beg.
* src/ios.cc: Lose _GLIBCPP_AVOID_FSEEK stuff.
* config/os/solaris/solaris2.?/bits/os_defines.h: Likewise.
* config/os/bsd/freebsd/bits/os_defines.h: Likewise.
* config/os/mingw32/bits/os_defines.h: Likewise.
* testsuite/27_io/filebuf_virtuals.cc (test05): Don't overspecify
ungetc test.
From-SVN: r52634
Diffstat (limited to 'libstdc++-v3/src/ios.cc')
-rw-r--r-- | libstdc++-v3/src/ios.cc | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/libstdc++-v3/src/ios.cc b/libstdc++-v3/src/ios.cc index 0aab0a25a3a..1d97bf9e7a8 100644 --- a/libstdc++-v3/src/ios.cc +++ b/libstdc++-v3/src/ios.cc @@ -150,14 +150,6 @@ namespace std int __out_bufsize = __sync ? 0 : static_cast<int>(BUFSIZ); int __in_bufsize = __sync ? 1 : static_cast<int>(BUFSIZ); -#if _GLIBCPP_AVOID_FSEEK - // Platforms that prefer to avoid fseek() calls on streams only - // get their desire when the C++-layer input buffer size is 1. - // This hack hurts performance but keeps correctness across - // all types of streams that might be attached to (e.g.) cin. - __in_bufsize = 1; -#endif - // NB: The file globals.cc creates the four standard files // with NULL buffers. At this point, we swap out the dummy NULL // [io]stream objects and buffers with the real deal. |