Commit Graph

2467 Commits

Author SHA1 Message Date
Andreas Tobler dc7c62aea4 acinclude.m4: Replace -W with more speaking -Wextra.
2004-05-03  Andreas Tobler  <a.tobler@schweiz.ch>

	* acinclude.m4: Replace -W with more speaking -Wextra.
	* configure: Rebuilt.

From-SVN: r81444
2004-05-03 21:07:49 +02:00
Paolo Carlini 4df9c41de5 Optimize locale::_M_impl->_M_names for the most common cases...
2004-05-03  Paolo Carlini  <pcarlini@suse.de>

	Optimize locale::_M_impl->_M_names for the most common cases:
	!_M_names[0] means unnamed; !_M_names[1] means all the categories
	the same name (_M_names[0] && _M_names[1] means that the full set
	of _M_names must be processed, the general case).
	* include/bits/locale_classes.h (locale::_Impl::_M_check_same_name):
	Tweak, saving work when !_M_names[1].
	(locale::locale(const locale&, _Facet*): Simplify: now just setting
	_M_names[0] = 0 means unnamed.
	* src/locale.cc (locale::operator==): Deal first with the common,
	easy cases, otherwise fall back to locale::name().
	(locale::name()): Tweak, if !_M_names[0] just return "*".
	(locale::_Impl::_Impl(const _Impl&, size_t): Tweak, early stop
	copying __imp._M_names if !__imp._M_names[0] or !__imp._M_names[1].
	* src/locale_init.cc (locale::_Impl::_Impl(size_t)): Tweak.
	* src/localename.cc (locale::_Impl::_Impl(const char*, size_t):
	Simplify when !std::strchr, just updating _M_names[0]; clean up.
	(locale::_Impl::_M_replace_categories): When !_M_names[1] prepare
	for the general case (full set of names), then do the usual work;
	clean up.

	* src/locale.cc (locale::name()): Reserve space in __ret.
	* src/locale_init.cc (locale::global(const locale&)): Save
	the name in a temporary.
	* src/localename.cc (locale::locale(const char*)): Reserve space
	in __str.

From-SVN: r81430
2004-05-03 12:14:07 +00:00
Paolo Carlini 5963910694 locale.cc (locale::operator==): Always avoid constructing locale::name(), directly compare pairs of _M_names.
2004-04-29  Paolo Carlini  <pcarlini@suse.de>

	* src/locale.cc (locale::operator==): Always avoid constructing
	locale::name(), directly compare pairs of _M_names.

From-SVN: r81309
2004-04-29 22:07:13 +00:00
Paolo Carlini 479864fe80 istream.tcc: Fix comment.
2004-04-26  Paolo Carlini  <pcarlini@suse.de>

	* include/bits/istream.tcc: Fix comment.

From-SVN: r81193
2004-04-26 15:26:18 +00:00
Paolo Carlini 874e7baa4c stl_vector.h: Trivial formatting fixes.
2004-04-26  Paolo Carlini  <pcarlini@suse.de>

	* include/bits/stl_vector.h: Trivial formatting fixes.
	* include/bits/vector.tcc: Likewise.

From-SVN: r81178
2004-04-26 09:02:43 +00:00
Paolo Carlini 247791f5d1 PR libstdc++/15002 (continued again)
2004-04-25  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/15002 (continued again)
	* include/bits/istream.tcc (getline(basic_istream<>&,
	basic_string<>&, _CharT)): Use a temporary buffer, thus
	avoiding reallocation for common case.

	* include/bits/basic_string.tcc (_S_construct(_InIterator,
	_InIterator, const _Alloc&, input_iterator_tag)): Tweak size
	of temporary buffer to a power of two.

	* testsuite/27_io/basic_istream/getline/char/4.cc: Add comment.

From-SVN: r81163
2004-04-25 15:45:13 +00:00
Paolo Carlini c26fa757dc 10.cc: New.
2004-04-25  Paolo Carlini  <pcarlini@suse.de>

	* testsuite/21_strings/basic_string/inserters_extractors/char/10.cc:
	New.
	* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/10.cc:
	Likewise.
	* testsuite/27_io/basic_istream/getline/char/5.cc: Likewise.

From-SVN: r81159
2004-04-25 12:56:41 +00:00
Paolo Carlini 062bf89593 PR libstdc++/15002 (continued)
2004-04-24  Paolo Carlini  <pcarlini@suse.de>
	    Petur Runolfsson  <peturr02@ru.is>

	PR libstdc++/15002 (continued)
	* include/bits/istream.tcc (basic_istream<>::getline(char_type*,
	streamsize, char_type)): Use traits::find/copy in a loop to speed
	up greatly the function in the common case (I/O buffer size >> 1).

2004-04-24  Paolo Carlini  <pcarlini@suse.de>

	* testsuite/27_io/basic_istream/getline/char/4.cc: New.

	* include/bits/istream.tcc (getline(basic_istream<>&,
	basic_string<>&, _CharT)): Change to use sgetc()/snextc() instead
	of sbumpc(), consistently with the other functions, thus also
	dealing correctly with the case of exceeded string::max_size().

Co-Authored-By: Petur Runolfsson <peturr02@ru.is>

From-SVN: r81146
2004-04-24 22:20:31 +00:00
Matthias Klose adabbcf475 Jonathan Wakely <cow@compsoc.man.ac.uk>
2004-04-24  Matthias Klose  <doko@debian.org>

        Jonathan Wakely  <cow@compsoc.man.ac.uk>
        * docs/html/configopts.html: Fix reference to allocator config option.

From-SVN: r81114
2004-04-23 22:06:51 +00:00
Andrew Pinski fc2ae4313b linkage.m4 (GLIBCXX_CHECK_MATH_SUPPORT): Check for libmx also.
2004-04-23  Andrew Pinski  <pinskia@physics.uc.edu>

        * linkage.m4 (GLIBCXX_CHECK_MATH_SUPPORT): Check for libmx also.
        * configure: Regenerate.

From-SVN: r81103
2004-04-23 13:06:56 -07:00
Daniel Jacobowitz d8fe7b2985 PR libstdc++/15047, libstdc++/11610
PR libstdc++/15047, libstdc++/11610
	* testsuite/lib/libstdc++.exp (v3-copy-files): Use remote_download.
	(libstdc++_init): Don't pass outdir to v3-copy-files.

From-SVN: r81094
2004-04-23 14:33:36 +00:00
Paolo Carlini 0d8c9baf81 deque.tcc: Trivial formatting fixes.
2004-04-21  Paolo Carlini  <pcarlini@suse.de>

	* include/bits/deque.tcc: Trivial formatting fixes.
	* include/bits/stl_deque.h: Likewise.
	* include/bits/stl_list.h: Likewise.
	* include/bits/stl_tree.h: Likewise.

From-SVN: r80960
2004-04-21 14:06:00 +00:00
Paolo Carlini 0a7460199f basic_string.tcc (_M_mutate): Don't compute __src unnecessarily.
2004-04-21  Paolo Carlini  <pcarlini@suse.de>
	    Andrew Pinski  <pinskia@physics.uc.edu>

	* include/bits/basic_string.tcc (_M_mutate): Don't compute
	__src unnecessarily.

Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu>

From-SVN: r80952
2004-04-21 09:23:36 +00:00
Benjamin Kosnik 3dd50c745b 9555-ic.cc: Clarify assertion, set test variable to false before assert.
2004-04-19  Benjamin Kosnik  <bkoz@redhat.com>

	* testsuite/27_io/basic_istream/extractors_character/char/9555-ic.cc:
	Clarify assertion, set test variable to false before assert.
	* testsuite/27_io/basic_istringstream/str/char/1.cc: Same.
	* testsuite/27_io/basic_stringstream/str/char/1.cc: Same.
	* testsuite/27_io/ios_base/storage/2.cc: Same.

	* testsuite/27_io/basic_filebuf/imbue/char/13171-4.cc: Fix
	function returns.
	* testsuite/27_io/basic_filebuf/imbue/wchar_t/13582-3.cc: Same.
	* testsuite/27_io/fpos/14320-3.cc: Same.

	* testsuite/27_io/basic_filebuf/2.cc: Instantiate in namespace std.
	* testsuite/27_io/fpos/1.cc: Same.
	* testsuite/27_io/basic_stringstream/2.cc: Same.
	* testsuite/27_io/basic_stringbuf/4.cc: Same.
	* testsuite/27_io/basic_stringbuf/1.cc: Same.
	* testsuite/27_io/basic_stringbuf/2.cc: Same.
	* testsuite/27_io/basic_streambuf/2.cc: Same.
	* testsuite/27_io/basic_ostringstream/2.cc: Same.
	* testsuite/27_io/basic_ostream/2.cc: Same.
	* testsuite/27_io/basic_ofstream/2.cc: Same.
	* testsuite/27_io/basic_istringstream/2.cc: Same.
	* testsuite/27_io/basic_istream/2.cc: Same.
	* testsuite/27_io/basic_iostream/2.cc: Same.
	* testsuite/27_io/basic_ios/2.cc: Same.
	* testsuite/27_io/basic_ifstream/2.cc: Same.
	* testsuite/27_io/basic_fstream/2.cc: Same.
	* testsuite/ext/stdio_filebuf/char/1.cc: Same, in namespace __gnu_cxx.

	* testsuite/21_strings/basic_string/capacity/1.cc: Don't compare
	unsigned against zero.
	* testsuite/21_strings/basic_string/capacity/wchar_t/1.cc: Same.
	* testsuite/21_strings/basic_string/capacity/char/1.cc: Same.

	* testsuite/18_support/new_delete_placement.cc: Initialize
	variables before first use.
	* testsuite/21_strings/char_traits/requirements/wchar_t/1.cc: Same.
	* testsuite/21_strings/char_traits/requirements/char/1.cc: Same.
	* testsuite/21_strings/char_traits/requirements/short/1.cc: Same.
	* testsuite/27_io/basic_istream/seekg/char/exceptions_badbit_throw.cc:
	Same.
	* testsuite/27_io/basic_ostream/inserters_arithmetic/char/exceptions_badbit_throw.cc: Same.
	* testsuite/27_io/basic_ostream/seekp/char/exceptions_badbit_throw.cc:
	Same.
	* testsuite/27_io/basic_ostream/inserters_arithmetic/char/exceptions_failbit_throw.cc: Same.
	* testsuite/27_io/types/2.cc: Same.

	* testsuite/ext/stdio_sync_filebuf/wchar_t/12077.cc: Fix temporary
	file name.
	* testsuite/27_io/fpos/14775.cc: Same.

From-SVN: r80861
2004-04-19 19:00:09 +00:00
Paolo Carlini 41b8e86c9a PR libstdc++/15002 (partial)
2004-04-19  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/15002 (partial)
	* include/bits/basic_string.h (_M_replace_aux, _M_replace_safe):
	Special case __n2 == 1, not calling traits_type::assign/copy.

From-SVN: r80847
2004-04-19 11:30:20 +00:00
Benjamin Kosnik f178c2d695 stl_bvector.h: Use _M_impl._M_start.
2004-04-17  Benjamin Kosnik  <bkoz@redhat.com>

	* include/bits/stl_bvector.h: Use _M_impl._M_start.

From-SVN: r80811
2004-04-18 05:04:58 +00:00
Benjamin Kosnik 390e4c0dbe c++config (_GLIBCXX_STD): New.
2004-04-16  Benjamin Kosnik  <bkoz@redhat.com>

	* include/bits/c++config (_GLIBCXX_STD): New.
	* src/list.cc: Use it.
	* include/std/std_bitset.h: Same.
	* include/bits/vector.tcc: Same.
	* include/bits/stl_set.h: Same.
	* include/bits/stl_multiset.h: Same.
	* include/bits/stl_multimap.h: Same.
	* include/bits/stl_map.h: Same.
	* include/bits/stl_list.h: Same.
	* include/bits/stl_vector.h: Same.
	* include/bits/stl_bvector.h: Same.
	* include/bits/stl_deque.h: Same.
	* include/bits/deque.tcc: Same.
	* include/bits/list.tcc: Same.
	* include/debug/vector: Same.
	* include/debug/set.h: Same.
	* include/debug/multiset.h: Same.
	* include/debug/multimap.h: Same.
	* include/debug/map.h: Same.
	* include/debug/list: Same.
	* include/debug/deque: Same.
	* include/debug/bitset: Same.
	* include/debug/formatter.h (__gnu_debug): Remove using directive.
	Add using declaration for std::type_info.
	* include/debug/safe_iterator.h: Add using declaration for
	std::iterator_traits and std::pair.
	* src/debug_list.cc: New.
	* src/Makefile.am: Add debug_list.cc.
	* src/Makefile.in: Regenerate.
	* config/linker-map.gnu: Add _List_node_base exports for std and
	__gnu_norm.

	* include/bits/stl_bvector.h (_Bvector_base): Use _Bvector_impl
	idiom that other containers use.
	* testsuite/23_containers/vector/bool/clear_allocator.cc: New.

From-SVN: r80763
2004-04-16 19:04:07 +00:00
Paolo Carlini 2f228199b9 re PR libstdc++/14975 ([3.4 only] Segfault on low-level write error during imbue)
2004-04-16  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/14975
	* include/bits/fstream.tcc (basic_filebuf::imbue): Zero _M_codecvt
	in case of error.
	* testsuite/27_io/basic_filebuf/imbue/char/14975-1.cc: New.
	* testsuite/27_io/basic_filebuf/imbue/wchar_t/14975-2.cc: New.

From-SVN: r80753
2004-04-16 16:06:21 +00:00
Paolo Carlini af55af57e1 acconfig.h: Remove _GLIBCXX_USE_LONG_DOUBLE entry, not used anymore.
2004-04-16  Paolo Carlini  <pcarlini@suse.de>

	* acconfig.h: Remove _GLIBCXX_USE_LONG_DOUBLE entry, not
	used anymore.
	* config.h.in: Regenerate.

2004-04-16  Paolo Carlini  <pcarlini@suse.de>

	* config/locale/generic/monetary_members.cc
	(moneypunct<wchar_t>::_M_initialize_moneypunct): Avoid calling
	btowc unnecessarily, just cast to wchar_t (the concerned chars
	all belong to the basic character set).
	* config/locale/generic/numeric_members.cc
	(numpunct<wchar_t>::_M_initialize_numpunct): Likewise.
	* config/locale/gnu/monetary_members.cc
	(moneypunct<wchar_t>::_M_initialize_moneypunct): Likewise.
	* config/locale/gnu/numeric_members.cc
	(numpunct<wchar_t>::_M_initialize_numpunct): Likewise.

From-SVN: r80746
2004-04-16 09:23:05 +00:00
Paolo Carlini d7ed521ba9 locale.cc (locale::operator==): When _M_impl == __rhs._M_impl avoid constructing unnecessarily this->name().
2004-04-15  Paolo Carlini  <pcarlini@suse.de>

	* src/locale.cc (locale::operator==): When _M_impl == __rhs._M_impl
	avoid constructing unnecessarily this->name().

From-SVN: r80714
2004-04-15 08:27:29 +00:00
Zack Weinberg 76e9802c68 Makefile.am: Add definition of AM_CXXFLAGS.
* testsuite/Makefile.am: Add definition of AM_CXXFLAGS.
	Change definition of CXX to use $(shell) instead of backticks.
	* testsuite/Makefile.in: Regenerate.

From-SVN: r80693
2004-04-14 21:10:52 +00:00
Dhruv Matani e0fb1c5c37 list_sort_search.cc: Minor formatting fixes.
2004-04-12  Dhruv Matani  <dhruvbird@gmx.net>

	* testsuite/performance/20_util/allocator/list_sort_search.cc:
	Minor formatting fixes.
	* testsuite/performance/20_util/allocator/map_mt_find.cc:
	Likewise.

From-SVN: r80624
2004-04-12 16:11:21 +00:00
Paolo Carlini 92861ad4a0 2004-04-12 Paolo Carlini <pcarlini@suse.de>
* config/locale/gnu/numeric_members.cc
	(numpunct<wchar_t>::_M_initialize_numpunct): No need to wrap
	in __uselocale, since btowc is called for chars belonging to
	the basic character set.

From-SVN: r80618
2004-04-12 08:36:23 +00:00
Paolo Carlini 895510be6f 1.cc: Remove junk.
2004-04-09  Paolo Carlini  <pcarlini@suse.de>

	* testsuite/22_locale/messages/members/char/1.cc: Remove junk.
	* testsuite/22_locale/messages/members/char/2.cc: Ditto.
	* testsuite/22_locale/messages/members/char/3.cc: Ditto.
	* testsuite/22_locale/num_get/get/char/1.cc: Ditto.
	* testsuite/22_locale/num_get/get/char/2.cc: Ditto.
	* testsuite/22_locale/num_get/get/char/3.cc: Ditto.
	* testsuite/22_locale/num_get/get/wchar_t/1.cc: Ditto.
	* testsuite/22_locale/num_get/get/wchar_t/2.cc: Ditto.
	* testsuite/22_locale/num_get/get/wchar_t/3.cc: Ditto.
	* testsuite/22_locale/num_put/put/char/1.cc: Ditto.
	* testsuite/22_locale/num_put/put/char/2.cc: Ditto.
	* testsuite/22_locale/num_put/put/char/3.cc: Ditto.
	* testsuite/22_locale/num_put/put/wchar_t/1.cc: Ditto.
	* testsuite/22_locale/num_put/put/wchar_t/2.cc: Ditto.
	* testsuite/22_locale/num_put/put/wchar_t/3.cc: Ditto.
	* testsuite/22_locale/numpunct/members/char/1.cc: Ditto.
	* testsuite/22_locale/numpunct/members/wchar_t/1.cc: Ditto.

From-SVN: r80545
2004-04-09 10:18:33 +00:00
Paolo Carlini ba98a8d81a time_members.cc (__timepunct<char>::_M_initialize_timepunct, [...]): the correct _M_amonth07 in the "C" locale is "Jul" and L"Jul", respectively.
2004-04-07  Paolo Carlini  <pcarlini@suse.de>

	* config/locale/generic/time_members.cc
	(__timepunct<char>::_M_initialize_timepunct,
	__timepunct<wchar_t>::_M_initialize_timepunct): the correct
	_M_amonth07 in the "C" locale is "Jul" and L"Jul", respectively.
	* config/locale/gnu/time_members.cc
	(__timepunct<char>::_M_initialize_timepunct,
	__timepunct<wchar_t>::_M_initialize_timepunct): Ditto.
	* testsuite/22_locale/time_get/get_monthname/char/4.cc: New.
	* testsuite/22_locale/time_get/get_monthname/wchar_t/4.cc: New.

	* testsuite/22_locale/time_get/date_order/char/1.cc: Remove junk.
	* testsuite/22_locale/time_get/date_order/wchar_t/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_date/char/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_date/char/2.cc: Ditto.
	* testsuite/22_locale/time_get/get_date/wchar_t/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_date/wchar_t/2.cc: Ditto.
	* testsuite/22_locale/time_get/get_monthname/char/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_monthname/char/2.cc: Ditto.
	* testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_monthname/wchar_t/2.cc: Ditto.
	* testsuite/22_locale/time_get/get_time/char/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_time/char/2.cc: Ditto.
	* testsuite/22_locale/time_get/get_time/wchar_t/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_time/wchar_t/2.cc: Ditto.
	* testsuite/22_locale/time_get/get_weekday/char/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_weekday/char/2.cc: Ditto.
	* testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_weekday/wchar_t/2.cc: Ditto.
	* testsuite/22_locale/time_get/get_year/char/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_year/wchar_t/1.cc: Ditto.
	* testsuite/22_locale/time_put/put/char/1.cc: Ditto.
	* testsuite/22_locale/time_put/put/char/2.cc: Ditto.
	* testsuite/22_locale/time_put/put/char/3.cc: Ditto.
	* testsuite/22_locale/time_put/put/char/4.cc: Ditto.
	* testsuite/22_locale/time_put/put/char/5.cc: Ditto.
	* testsuite/22_locale/time_put/put/char/6.cc: Ditto.
	* testsuite/22_locale/time_put/put/char/7.cc: Ditto.
	* testsuite/22_locale/time_put/put/char/8.cc: Ditto.
	* testsuite/22_locale/time_put/put/wchar_t/1.cc: Ditto.
	* testsuite/22_locale/time_put/put/wchar_t/2.cc: Ditto.
	* testsuite/22_locale/time_put/put/wchar_t/3.cc: Ditto.
	* testsuite/22_locale/time_put/put/wchar_t/4.cc: Ditto.
	* testsuite/22_locale/time_put/put/wchar_t/5.cc: Ditto.
	* testsuite/22_locale/time_put/put/wchar_t/6.cc: Ditto.
	* testsuite/22_locale/time_put/put/wchar_t/7.cc: Ditto.
	* testsuite/22_locale/time_put/put/wchar_t/8.cc: Ditto.

	* testsuite/22_locale/time_put/put/char/9780-1.cc: Fix typos.

From-SVN: r80493
2004-04-07 23:14:08 +00:00
Paolo Carlini f332a090b2 2004-04-07 Paolo Carlini <pcarlini@suse.de>
* config/locale/gnu/monetary_members.cc
	(moneypunct<wchar_t>::_M_initialize_moneypunct): Prefer
	_NL_MONETARY_DECIMAL_POINT_WC, _NL_MONETARY_THOUSANDS_SEP_WC,
	and __MON_GROUPING to _NL_NUMERIC_DECIMAL_POINT_WC,
	_NL_NUMERIC_THOUSANDS_SEP_WC, and GROUPING.
	* config/locale/gnu/numeric_members.cc
	(numpunct<char>::_M_initialize_numpunct): Prefer DECIMAL_POINT
	and THOUSANDS_SEP to the deprecated RADIXCHAR and THOUSEP.

From-SVN: r80477
2004-04-07 14:32:47 +00:00
Benjamin Kosnik 563ae04fec Fixups for EDG front end.
2004-04-06  Benjamin Kosnik  <bkoz@redhat.com>

	Fixups for EDG front end.
	* include/ext/rope: Instead of non-existent function
	_Data_allocate, use allocator's allocate. Use this.
	(namespace _Rope_constants): Move _S_max_rope_depth, and _Tag
	enumerations from _Rope_RopeRep here.
	* include/ext/ropeimpl.h: Same.
	* src/ext-inst.cc (_S_min_len): Fix up definition.

	* config/locale/gnu/ctype_members.cc: Qualify base class members
	with this.
	* config/locale/generic/ctype_members.cc: Same.
	* config/locale/gnu/messages_members.h: Same.
	* config/locale/generic/messages_members.h: Same.
	* src/ctype.cc: Same.
	* include/bits/codecvt.h: Same.

	* include/bits/boost_concept_check.h: Declare.
	(__error_type_must_be_an_unsigned_integer_type): Remove this.
	(__error_type_must_be_an_integer_type): Remove this.
	(__error_type_must_be_a_signed_integer_type): Remove this.

	* config/io/basic_file_stdio.cc (__basic_file::sys_open): Remove cast.

	* libsupc++/eh_alloc.cc (__cxa_free_exception): Add exception
	specification to definition.
	(__cxa_allocate_exception): Same.
	* libsupc++/eh_catch.cc (__cxa_begin_catch): Same.
	* libsupc++/eh_globals.cc (__cxa_get_globals_fast): Same.
	(__cxa_get_globals): Same.

	* libsupc++/del_op.cc: Add comment about freestanding.

From-SVN: r80475
2004-04-07 03:33:36 +00:00
Paolo Carlini 268d3b1832 mt_allocator.h (__mt_alloc<>::deallocate): The critical section is actually very small, only two assignments.
2004-04-05  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/mt_allocator.h (__mt_alloc<>::deallocate):
	The critical section is actually very small, only two assignments.

From-SVN: r80439
2004-04-05 22:46:04 +00:00
Paolo Carlini 9f35e4aab5 filebuf_sputn_unbuf.cc: New, adapted from libstdc++/11378.
2004-04-04  Paolo Carlini  <pcarlini@suse.de>
	    Petur Runolfsson  <peturr02@ru.is>

	* testsuite/performance/27_io/filebuf_sputn_unbuf.cc: New,
	adapted from libstdc++/11378.

Co-Authored-By: Petur Runolfsson <peturr02@ru.is>

From-SVN: r80398
2004-04-04 18:18:29 +00:00
Paolo Carlini c8333c0fd5 mt_allocator.h (__mt_alloc<>::allocate): Factor out some duplicated code.
2004-04-03  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/mt_allocator.h (__mt_alloc<>::allocate): Factor out
	some duplicated code.
	(__mt_alloc<>::_Bin_record): Spare the space of _M_free and _M_used
	in the single threaded case.
	* testsuite/performance/20_util/allocator/list_sort_search.cc:
	Reorder and renumber the tests consistently with the other testfiles.
	* testsuite/performance/20_util/allocator/map_mt_find.cc: Ditto.
	* testsuite/performance/20_util/allocator/map_thread.cc: Ditto.
	* testsuite/performance/20_util/allocator/producer_consumer.cc: Ditto.

From-SVN: r80375
2004-04-03 13:39:16 +00:00
Paolo Carlini ab40b100d3 mt_allocator.h (__mt_alloc<>::deallocate): Rearrange arithmetic to avoid computing two divisions at each deallocation.
2004-04-02  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/mt_allocator.h (__mt_alloc<>::deallocate):
	Rearrange arithmetic to avoid computing two divisions at
	each deallocation.

From-SVN: r80356
2004-04-02 19:51:21 +00:00
Paolo Carlini 354d4c68c6 mt_allocator.h (__mt_alloc<>::_S_initialize): Streamline the second half...
2004-04-01  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/mt_allocator.h (__mt_alloc<>::_S_initialize):
	Streamline the second half, wrapping it in a single
	'#ifdef __GTHREADS if (__gthread_active_p())' and avoiding
	conditionals inside loops.

From-SVN: r80323
2004-04-01 21:47:59 +00:00
Paolo Carlini 2ae6e9823a re PR libstdc++/14775 ([3.4 only] LFS tests missing)
2004-04-01  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/14775
	* acconfig.h: Rename _GLIBCXX_MEM_LIMITS to _GLIBCXX_RES_LIMITS.
	* acinclude.m4 (GLIBCXX_CHECK_SETRLIMIT): Call
	GLIBCXX_CHECK_SETRLIMIT_ancilliary for FSIZE too, adjust define
	to _GLIBCXX_RES_LIMITS.
	(GLIBCXX_CHECK_SETRLIMIT_ancilliary): Rename HAVE_MEMLIMIT_* to
	HAVE_LIMIT_*.
	* testsuite/testsuite_hooks.h: Declare set_file_limit.
	* testsuite/testsuite_hooks.cc: Define it, using getrlimit
	and setrlimit(RLIMIT_FSIZE).
	* testsuite/27_io/fpos/14775.cc: New.
	* config.h.in: Regenerate.
	* configure: Likewise.

From-SVN: r80289
2004-04-01 09:16:36 +00:00
Paolo Carlini e004c3313e c_locale.cc (__convert_to_v(long double&)): In v3 uses of sscanf...
2004-03-31  Paolo Carlini  <pcarlini@suse.de>

	* config/locale/generic/c_locale.cc (__convert_to_v(long double&)):
	In v3 uses of sscanf, the special floating-point numbers INF,
	INFINITY, etc., cannot occur in input, therefore, if the latter
	is too large, ERANGE is always stored in errno, no need of finitel.

From-SVN: r80247
2004-03-31 09:13:10 +00:00
Benjamin Kosnik 06ce772609 re PR libstdc++/14783 (Warning in std::set constructor at bits/stl_tree.h:403)
2004-03-30  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/14783
	* include/bits/stl_tree.h: Adjust initialization list order.

From-SVN: r80095
2004-03-30 21:04:19 +00:00
Loren J. Rittle 7be1c3fba9 Update comment to reflect test.
From-SVN: r80067
2004-03-29 23:42:05 +00:00
Paolo Carlini 63041e68a4 pthread7-rope.cc: Fix...
2004-03-29  Paolo Carlini  <pcarlini@suse.de>

	* testsuite/thread/pthread7-rope.cc: Fix, unpredictably, depending
	on allocator behavior, the memory pointed by data2 may well be not
	trashed.

From-SVN: r80051
2004-03-29 09:54:15 +00:00
Chavdar Botev f26e5597f0 re PR libstdc++/14245 ([3.4 only] problem with user-defined allocators in std::basic_string)
2004-03-28  Chavdar Botev  <cbotev@yahoo.com>

	PR libstdc++/14245
	* include/bits/basic_string.tcc
	(basic_string::basic_string(const basic_string&)): Pass to
	_Rep::_M_grab the actual allocator of the string being constructed
	not the default constructed one.

From-SVN: r80041
2004-03-28 16:27:27 +00:00
Benjamin Kosnik a5f105b590 [multiple changes]
2004-03-27  Benjamin Kosnik  <bkoz@redhat.com>

	libstdc++ PR/13598
	* config/locale/ieee_1003.1-2001/codecvt_specializations.h
	(__enc_traits::_M_destroy): New.
	(__enc_traits::~__enc_traits): Use it.
	(__enc_traits::operator=): Use _M_destroy, _M_init.
	(__enc_traits::__enc_traits): Same.

2004-03-27  Petur Runolfsson  <peturr02@ru.is>

	* testsuite/ext/enc_filebuf/char/13598.cc: New.

From-SVN: r80027
2004-03-27 16:21:21 +00:00
Paolo Carlini 6f52a889fd [multiple changes]
2004-03-27  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/mt_allocator.h: Uglify consistently names of
	variables, members and classes; tidy.

2004-03-27  Dhruv Matani  <dhruvbird@gmx.net>

	* include/ext/mt_allocator.h (__mt_alloc<>::deallocate):
	Deallocation loop rewrote.

From-SVN: r80012
2004-03-27 10:15:49 +00:00
Paolo Carlini dd95381f8a mt_allocator.h (__mt_alloc<>::allocate, [...]): Protect two instances of block->thread_id with __GTHREADS.
2004-03-26  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/mt_allocator.h (__mt_alloc<>::allocate,
	__mt_alloc<>::deallocate): Protect two instances of
	block->thread_id with __GTHREADS.

From-SVN: r79986
2004-03-26 16:56:09 +00:00
Benjamin Kosnik 8bd22a3ceb [multiple changes]
2004-03-25  Gawain Bolton  <gp.bolton@computer.org>

	* include/bits/stl_tree.h (_Rb_tree_impl): Add _Node_allocator
	default argument in constructors.
	(_Rb_tree::_M_empty_initialize): Remove.

2004-03-25  Benjamin Kosnik  <bkoz@redhat.com>

	* testsuite/23_containers/map/operators/1_neg.cc: Adjust line numbers.
	* testsuite/23_containers/set/operators/1_neg.cc: Same.

2004-03-25  Dhruv Matani  <dhruvbird@gmx.net>

	* include/bits/cpp_type_traits.h: Changed __is_pod
	completely. Now, it does not use any of the previous type_traits
	to detect the pod types, and it also detects function pointers as
	POD types.

	* include/bits/stl_tree.h: Introduced a new class _Rb_tree_impl,
	which encapsulates the internal implementation of an rb_tree. Made
	the allocator a base class of this class instead of the rb_tree,
	which was not conforming. This _Rb_tree_impl class is also
	specialized on whether the _Compare parameter is a POD type or
	not. If so, then it maintains the comparison function as a data
	member, otherwise it makes the _Compare parameter a base class of
	itself. Also, _M_key_compare is now a function instead of a data
	member, so that the above trick can work properly. Delegated the
	initialization of the other data members to this newly created
	class. Also, now other member functions of rb_tree must refer to
	_M_key_compare as _M_impl._M_key_compare(). The other data members
	(*) can be referenced to as _M_impl.(*), where
	(*) includes _M_header, and _M_node_count.

From-SVN: r79977
2004-03-26 00:38:57 +00:00
Paolo Carlini 90ceccd46e mt_allocator.h (__mt_alloc<>::tune): Add _M_min_bin, the size in bytes of the smallest bin.
2004-03-25  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/mt_allocator.h (__mt_alloc<>::tune):
	Add _M_min_bin, the size in bytes of the smallest bin.
	(__mt_alloc<>::tune()): Tweak accordingly.
	(__mt_alloc<>::tune(size_t, ...)): Likewise.
	(__mt_alloc<>::block_record): Change to a union: members next
	and thread_id are never used at the same time.
	(__mt_alloc<>::allocate): Update consistently.
	(__mt_alloc<>::deallocate): Likewise.
	(__mt_alloc<>::_S_initialize): Update setups of _S_binmap and
	_S_bin_size for the configurable _M_min_size.

From-SVN: r79962
2004-03-25 18:23:40 +00:00
Dhruv Matani 03f9ea4437 stl_list.h: Created a _List_impl class and made it derive from the allocator...
2004-03-25  Dhruv Matani  <dhruvbird@gmx.net>

	* include/bits/stl_list.h: Created a _List_impl class and made it
	derive from the allocator, instead of the list deriving from the
	allocator class, which was not conformant. Changed all references
	from this->_M_node to this->_M_impl._M_node * bits/list.tcc: Same
	as above (changed all references to the concerned variables).

2004-03-25  Dhruv Matani  <dhruvbird@gmx.net>

	* include/bits/stl_deque.h: Created a _Deque_impl class and made
	it derive from the allocator, instead of the deque deriving from
	the allocator class, which was not conformant. Changed all
	references to the _M_start, _M_finish, _M_map, and _M_map_size to
	_M_impl.*.
	(_Deque_base<_Tp,_Alloc>::~_Deque_base()): Added this->
	qualification in 2 places where it was missing.
	(_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t)): Same as
	above.
	* include/bits/deque.tcc: Same as above (changed all references to
	the concerned variables).

2004-03-25  Dhruv Matani  <dhruvbird@gmx.net>

	* include/bits/stl_vector.h: Created a _Vector_impl class and made
	it derive from the allocator, instead of the _Vector_base class,
	deriving from the allocator which was not conformant. Changed all
	references to the _M_start, _M_finish, and _M_end_of_storage to
	_M_impl.*.
	* include/bits/vector.tcc: Same as above (changed all references
	to the concerned variables).

2004-03-25  Dhruv Matani  <dhruvbird@gmx.net>

	* testsuite/23_containers/deque/cons/clear_allocator.cc: New.
	* testsuite/23_containers/list/cons/clear_allocator.cc: New.
	* testsuite/23_containers/vector/cons/clear_allocator.cc: New.

From-SVN: r79957
2004-03-25 17:12:16 +00:00
Dhruv Matani 58c959212f malloc_allocator.h: Fixed the construct function to call global placement new instead of assignment.
2004-03-24  Dhruv Matani  <dhruvbird@gmx.net>

	* ext/malloc_allocator.h: Fixed the construct function to call
	global placement new instead of assignment. Added a check after
	the return from malloc to check whether returned pointer is NULL,
	and if so, throw std::bad_alloc().
	* ext/debug_allocator.h: Added a check in the deallocate function
	to check whether the user has passed a NULL pointer or not.

From-SVN: r79934
2004-03-24 21:40:01 +00:00
Benjamin Kosnik 8367b9c1e9 allocator.html: Add bitmap_allocator links.
2004-03-24  Benjamin Kosnik  <bkoz@redhat.com>

	* docs/html/20_util/allocator.html: Add bitmap_allocator links.

From-SVN: r79933
2004-03-24 21:30:26 +00:00
Andreas Schwab d62c1a1f98 prune.exp (prune_gcc_output): Ignore errata warning from IA64 assembler.
gcc/testsuite/:
	* lib/prune.exp (prune_gcc_output): Ignore errata warning from
	IA64 assembler.

libstdc++-v3/:
	* testsuite/lib/prune.exp (prune_g++_output): Ignore errata
	warning from IA64 assembler.

From-SVN: r79929
2004-03-24 19:54:26 +00:00
Dhruv Matani 71f9a9d15e bitmap_allocator.h: (_Bit_scan_forward) -> Made this function call __builtin_ctz instead of the...
2004-03-24  Dhruv Matani  <dhruvbird@gmx.net>

	* include/ext/bitmap_allocator.h: (_Bit_scan_forward) -> Made this
	function call __builtin_ctz instead of the while loop.
	(allocate) -> If condition has __builtin_expect.
	(deallocate) -> Ditto.
	Renamed a few left-over variables and typedefs according to the
	C++STYLE mentioned in the documentation.
	Protected calls to __gthread* by __gthread_active_p(), whose value
	is cached in the local variable __threads_active.

From-SVN: r79924
2004-03-24 18:27:43 +00:00
Felix Yen b4a76c01db producer_consumer.cc: Use linear algorithm for producer.
2004-03-24  Felix Yen  <fwy@alumni.brown.edu>

	* testsuite/performance/20_util/allocator/producer_consumer.cc:
	Use linear algorithm for producer.

From-SVN: r79920
2004-03-24 17:16:07 +00:00
Paolo Carlini affb18b2fa mt_allocator.h (__mt_alloc<>::allocate, [...]): Avoid redundant conditionals.
2004-03-24  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/mt_allocator.h (__mt_alloc<>::allocate,
	__mt_alloc<>::deallocate): Avoid redundant conditionals.

From-SVN: r79917
2004-03-24 15:25:37 +00:00