hashtable exception safety patch

François Dumont frs.dumont@gmail.com
Wed Sep 14 19:51:00 GMT 2011


On 09/13/2011 10:14 PM, Paolo Carlini wrote:
> Hi,
>
>>     To rebase would have forced me to delay the patch of one day which I try to avoid... without success. Here it is again.
> Sorry about that, I was annoyed seeing a bit of - surely, trivial - work I had done on the orig patch nullified. Thanks for your patience.
>
> Paolo
Attached patch applied.

2011-09-14  François Dumont <fdumont@gcc.gnu.org>
             Paolo Carlini <paolo.carlini@oracle.com>

         * include/bits/hashtable.h (_Hashtable<>::_M_rehash): Take and 
restore
         hash policy _M_prev_resize on exception.
         (_Hashtable<>::_M_insert_bucket): Capture hash policy next resize
         before using it and use latter method to have it restored on 
exception.
         (_Hashtable<>::_M_insert(_Arg&& __v, std::false_type): Likewise.
         (_Hashtable<>::insert(_InputIterator, _InputIterator): Likewise.
         (_Hashtable<>::rehash): Likewise.
         * testsuite/23_containers/unordered_set/insert/hash_policy.cc: New.
         * testsuite/23_containers/unordered_multiset/insert/hash_policy.cc:
         Likewise.

François

-------------- next part --------------
A non-text attachment was scrubbed...
Name: hashtable_1.patch
Type: text/x-patch
Size: 11504 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20110914/288a6512/attachment.bin>


More information about the Libstdc++ mailing list