]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2008-10-14 Paolo Carlini <paolo.carlini@oracle.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 14 Oct 2008 15:02:45 +0000 (15:02 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 14 Oct 2008 15:02:45 +0000 (15:02 +0000)
* include/bits/stl_tree.h (_Rb_tree<>::max_size): Use Node_allocator
for improved accuracy.
* include/bits/stl_list.h (list<>::max_size): Likewise.
* testsuite/23_containers/multimap/capacity/29134.cc: Adjust.
* testsuite/23_containers/set/capacity/29134.cc: Likewise.
* testsuite/23_containers/multiset/capacity/29134.cc: Likewise.
* testsuite/23_containers/list/capacity/29134.cc: Likewise.
* testsuite/23_containers/map/capacity/29134.cc: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141110 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_list.h
libstdc++-v3/include/bits/stl_tree.h
libstdc++-v3/testsuite/23_containers/list/capacity/29134.cc
libstdc++-v3/testsuite/23_containers/map/capacity/29134.cc
libstdc++-v3/testsuite/23_containers/multimap/capacity/29134.cc
libstdc++-v3/testsuite/23_containers/multiset/capacity/29134.cc
libstdc++-v3/testsuite/23_containers/set/capacity/29134.cc

index 2d969f1279591d198373ffd3d71662923e7dc28f..63cb52f169a69e4f6a6133434fb95df412352433 100644 (file)
@@ -1,3 +1,14 @@
+2008-10-14  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * include/bits/stl_tree.h (_Rb_tree<>::max_size): Use Node_allocator
+       for improved accuracy.
+       * include/bits/stl_list.h (list<>::max_size): Likewise.
+       * testsuite/23_containers/multimap/capacity/29134.cc: Adjust.
+       * testsuite/23_containers/set/capacity/29134.cc: Likewise.
+       * testsuite/23_containers/multiset/capacity/29134.cc: Likewise.
+       * testsuite/23_containers/list/capacity/29134.cc: Likewise.
+       * testsuite/23_containers/map/capacity/29134.cc: Likewise.
+
 2008-10-10  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * testsuite/20_util/reference_wrapper/24803.cc: Avoid uninitialized
index 91c339c1746f4db0529120f4f34084f2495aef49..7f31e3ccfc1624fe03bca6661752b5aae26b8b35 100644 (file)
@@ -807,7 +807,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
       /**  Returns the size() of the largest possible %list.  */
       size_type
       max_size() const
-      { return _M_get_Tp_allocator().max_size(); }
+      { return _M_get_Node_allocator().max_size(); }
 
       /**
        *  @brief Resizes the %list to the specified number of elements.
index d922a6db4dddc65fb4d21aa591bbfa48d3a6e39f..73b75e46268343e63fdfeb36fc8cdbe1e4f3b436 100644 (file)
@@ -1,6 +1,6 @@
 // RB tree implementation -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -643,7 +643,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
       size_type
       max_size() const
-      { return get_allocator().max_size(); }
+      { return _M_get_Node_allocator().max_size(); }
 
       void
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
index 513466565f62534cbca84c953986ff4652a9f116..f334479431a7b5679d0ea60aeb764f00c7139249 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -28,7 +28,13 @@ void test01()
 
   std::list<int> l;
 
-  VERIFY( l.max_size() == l.get_allocator().max_size() );
+#ifndef _GLIBCXX_DEBUG
+  using std::_List_node;
+#else
+  using std::_GLIBCXX_STD_D::_List_node;
+#endif
+
+  VERIFY( l.max_size() == std::allocator<_List_node<int> >().max_size() );
 }
 
 int main()
index 6383eefa3ab1c6dc7a01be1a80f37c88b39b28ce..b43f091e31ff0e58618d53904bbc2ae80d00985f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -28,7 +28,8 @@ void test01()
 
   std::map<int, int> m;
 
-  VERIFY( m.max_size() == m.get_allocator().max_size() );
+  VERIFY( (m.max_size() == std::allocator<std::_Rb_tree_node<
+                          std::pair<const int, int> > >().max_size()) );
 }
 
 int main()
index 466a3341f9e79fd02114a35115aae3cb26c795dd..c592fd1f1bde7d2ab45fd785a4772272f1732075 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -28,7 +28,8 @@ void test01()
 
   std::multimap<int, int> mm;
 
-  VERIFY( mm.max_size() == mm.get_allocator().max_size() );
+  VERIFY( (mm.max_size() == std::allocator<std::_Rb_tree_node<
+                           std::pair<const int, int> > >().max_size()) );
 }
 
 int main()
index ddfb165e8d9b87333db1fc661cbe6de98a942801..f75e65268ffc1e5dfda2ae289e0ea2fdd86b431a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -28,7 +28,8 @@ void test01()
 
   std::multiset<int> ms;
 
-  VERIFY( ms.max_size() == ms.get_allocator().max_size() );
+  VERIFY( ms.max_size()
+         == std::allocator<std::_Rb_tree_node<int> >().max_size() );
 }
 
 int main()
index 51650399b733b468c26db7ea0492714891969114..6669f27d1eacb0d628fd045d09f0f1df16cadeca 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -28,7 +28,8 @@ void test01()
 
   std::set<int> s;
 
-  VERIFY( s.max_size() == s.get_allocator().max_size() );
+  VERIFY( s.max_size() ==
+         std::allocator<std::_Rb_tree_node<int> >().max_size() );
 }
 
 int main()