hash policy patch

François Dumont francois.cppdevs@free.fr
Sat Jul 23 23:31:00 GMT 2011


Hi

     While working on DR 41975 I realized a small issue in current 
rehash implementation that sometimes lead to load_factor being greater 
than max_load_factor. Here is a patch to fix that:

2011-07-23  François Dumont <francois.cppdevs@free.fr>

         * include/bits/hashtable_policy.h (_Prime_rehash_policy): Use
         __builtin_floor rather than __builtin_ceil to compute next resize
         value.
         * testsuite/23_containers/unordered_set/hash_policy/load_factor.cc:
         New.

François
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hash_policy.patch
Type: text/x-patch
Size: 3307 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20110723/49594a0c/attachment.bin>


More information about the Libstdc++ mailing list