Fix hashtable memory leak

François Dumont frs.dumont@gmail.com
Tue Nov 27 21:31:00 GMT 2018


I eventually called the new method _M_assign_elements.

And yes, tracker_allocator was enough.

Committed on trunk for the moment.

François


On 11/26/18 1:12 PM, Jonathan Wakely wrote:
> On 24/11/18 22:58 +0100, François Dumont wrote:
>> --- 
>> a/libstdc++-v3/testsuite/23_containers/unordered_set/allocator/move_assign.cc
>> +++ 
>> b/libstdc++-v3/testsuite/23_containers/unordered_set/allocator/move_assign.cc
>> @@ -18,6 +18,8 @@
>> // { dg-do run { target c++11 } }
>>
>> #include <unordered_set>
>> +#include <ext/throw_allocator.h>
>> +
>> #include <testsuite_hooks.h>
>> #include <testsuite_allocator.h>
>> #include <testsuite_counter_type.h>
>> @@ -27,7 +29,9 @@ using __gnu_test::counter_type;
>>
>> void test01()
>> {
>> -  typedef propagating_allocator<counter_type, false> alloc_type;
>> +  {
>> +    typedef propagating_allocator<counter_type, false,
>> + __gnu_cxx::throw_allocator_limit<counter_type>> alloc_type;
>
> You don't seem to need the throw_allocator here, can't you use
> __gnu_test::tracker_allocator from <testsuite_allocator.h> instead?
>
> .
>



More information about the Libstdc++ mailing list