2018-09-18 François Dumont <fdumont@gcc.gnu.org>
commit2646a43f79bad960b25f35ccf12a2b079006a768
authorfdumont <fdumont@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Sep 2018 20:36:16 +0000 (18 20:36 +0000)
committerfdumont <fdumont@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Sep 2018 20:36:16 +0000 (18 20:36 +0000)
tree0d8e691c655254cfc40fc4d1416b1a47c34e35bb
parentcae7e4ec8e10098cb48e3c059a652c8c63b18627
2018-09-18  François Dumont  <fdumont@gcc.gnu.org>

PR libstdc++/87135
* src/c++11/hashtable_c++0x.cc:
(_Prime_rehash_policy::_M_next_bkt): Return a prime no smaller than
requested size, but not necessarily greater.
(_Prime_rehash_policy::_M_need_rehash): Rehash only if target size is
strictly greater than next resize threshold.
* testsuite/23_containers/unordered_map/modifiers/reserve.cc: Adapt test
to validate that there is no rehash as long as number of insertion is
lower or equal to the reserved number of elements.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264413 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/src/c++11/hashtable_c++0x.cc
libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/reserve.cc