libstdc++/4150: catastrophic performance decrease in C++ code
Jason Merrill
jason@redhat.com
Mon Apr 22 12:11:00 GMT 2002
Here's a more limited patch, which just avoids the seeking. Rather than
define _M_in_end to indicate the file pointer, it adds another member.
2002-04-20 Jason Merrill <jason@redhat.com>
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-patch
Size: 12178 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20020422/5c4d0cfc/attachment.bin>
More information about the Libstdc++
mailing list