From 92188635ab31ed4ebb378169b5d11928dac444b9 Mon Sep 17 00:00:00 2001 From: fdumont Date: Wed, 10 Nov 2010 21:53:43 +0000 Subject: [PATCH] =?utf8?q?2010-11-10=20=20Fran=C3=A7ois=20Dumont=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * include/profile/unordered_map (unordered_map<>::_M_profile_size): Simplify, don't take a __new_size argument; adjust all callers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166560 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 17 +++++++++++------ libstdc++-v3/include/profile/unordered_map | 25 ++++++++++++------------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d5a5a96..ab6a3fc 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2010-11-10 François Dumont + + * include/profile/unordered_map (unordered_map<>::_M_profile_size): + Simplify, don't take a __new_size argument; adjust all callers. + 2010-11-10 Paolo Carlini PR libstdc++/44436 (partial) @@ -1524,13 +1529,13 @@ 2010-09-03 François Dumont - * testsuite/lib/libstdc++.exp ([check_v3_target_debug_mode]): Fix so - that it really detects when debug mode is activated. - * testsuite/util/debug/construct_neg.h, insert_neg.h, assign_neg.h: - Remove, content moved... - * testsuite/util/debug/checks.h: ... here. Modify checks to take the + * testsuite/lib/libstdc++.exp ([check_v3_target_debug_mode]): Fix so + that it really detects when debug mode is activated. + * testsuite/util/debug/construct_neg.h, insert_neg.h, assign_neg.h: + Remove, content moved... + * testsuite/util/debug/checks.h: ... here. Modify checks to take the type of the container to test rather than an intermediate container - type traits helper. + type traits helper. * testsuite/23_containers/unordered_map/debug/insert1_neg.cc: Update to use dg-require-debug-mode when necessary and use new check functions. * testsuite/23_containers/unordered_map/debug/construct1_neg.cc: diff --git a/libstdc++-v3/include/profile/unordered_map b/libstdc++-v3/include/profile/unordered_map index 49345cc..6d6a8b7 100644 --- a/libstdc++-v3/include/profile/unordered_map +++ b/libstdc++-v3/include/profile/unordered_map @@ -170,7 +170,7 @@ namespace __profile { size_type __old_size = _Base::bucket_count(); _Base::insert(__l); - _M_profile_resize(__old_size, _Base::bucket_count()); + _M_profile_resize(__old_size); } std::pair @@ -178,7 +178,7 @@ namespace __profile { size_type __old_size = _Base::bucket_count(); std::pair __res = _Base::insert(__obj); - _M_profile_resize(__old_size, _Base::bucket_count()); + _M_profile_resize(__old_size); return __res; } @@ -187,7 +187,7 @@ namespace __profile { size_type __old_size = _Base::bucket_count(); iterator __res = _Base::insert(__iter, __v); - _M_profile_resize(__old_size, _Base::bucket_count()); + _M_profile_resize(__old_size); return __res; } @@ -200,7 +200,7 @@ namespace __profile size_type __old_size = _Base::bucket_count(); std::pair __res = _Base::insert(std::forward<_Pair>(__obj)); - _M_profile_resize(__old_size, _Base::bucket_count()); + _M_profile_resize(__old_size); return __res; } @@ -212,7 +212,7 @@ namespace __profile { size_type __old_size = _Base::bucket_count(); iterator __res = _Base::insert(__iter, std::forward<_Pair>(__v)); - _M_profile_resize(__old_size, _Base::bucket_count()); + _M_profile_resize(__old_size); return __res; } @@ -222,7 +222,7 @@ namespace __profile { size_type __old_size = _Base::bucket_count(); _Base::insert(__first, __last); - _M_profile_resize(__old_size, _Base::bucket_count()); + _M_profile_resize(__old_size); } void @@ -230,7 +230,7 @@ namespace __profile { size_type __old_size = _Base::bucket_count(); _Base::insert(__first, __last); - _M_profile_resize(__old_size, _Base::bucket_count()); + _M_profile_resize(__old_size); } // operator[] @@ -239,8 +239,7 @@ namespace __profile { size_type __old_size = _Base::bucket_count(); mapped_type& __res = _M_base()[__k]; - size_type __new_size = _Base::bucket_count(); - _M_profile_resize(__old_size, _Base::bucket_count()); + _M_profile_resize(__old_size); return __res; } @@ -249,8 +248,7 @@ namespace __profile { size_type __old_size = _Base::bucket_count(); mapped_type& __res = _M_base()[std::move(__k)]; - size_type __new_size = _Base::bucket_count(); - _M_profile_resize(__old_size, _Base::bucket_count()); + _M_profile_resize(__old_size); return __res; } @@ -262,13 +260,14 @@ namespace __profile { size_type __old_size = _Base::bucket_count(); _Base::rehash(__n); - _M_profile_resize(__old_size, _Base::bucket_count()); + _M_profile_resize(__old_size); } private: void - _M_profile_resize(size_type __old_size, size_type __new_size) + _M_profile_resize(size_type __old_size) { + size_type __new_size = _Base::bucket_count(); if (__old_size != __new_size) __profcxx_hashtable_resize(this, __old_size, __new_size); } -- 2.7.4