From ecf07a67d0e8cc33b780783d9996a0e91a6239a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Dumont?= Date: Thu, 8 Nov 2012 20:16:04 +0000 Subject: re PR libstdc++/54075 ([4.7.1] unordered_map insert still slower than 4.6.2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2012-11-08 François Dumont PR libstdc++/54075 * include/bits/hashtable.h (_Hashtable<>::rehash): Reset hash policy state if no rehash. * testsuite/23_containers/unordered_set/modifiers/reserve.cc (test02): New. From-SVN: r193339 --- libstdc++-v3/include/bits/hashtable.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libstdc++-v3/include') diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h index 8ceacab..9b2677b 100644 --- a/libstdc++-v3/include/bits/hashtable.h +++ b/libstdc++-v3/include/bits/hashtable.h @@ -1654,6 +1654,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // level. _M_rehash_policy._M_prev_resize = 0; } + else + // No rehash, restore previous state to keep a consistent state. + _M_rehash_policy._M_reset(__saved_state); } template