Fix hashtable node deallocation
Jonathan Wakely
jwakely@redhat.com
Mon Nov 19 12:33:00 GMT 2018
On 17/11/18 22:01 +0100, François Dumont wrote:
>Here is the same patch but this time with a test change which is
>supposed to show the problem.
>
>However it doesn't because of:
>Â Â Â Â Â _Pointer_adapter(element_type* __arg = 0)
>Â Â Â Â Â { _Storage_policy::set(__arg); }
>
>which is not explicit.
>
>So is this patch really necessary ? If it isn't, is usage of
>pointer_traits<>::pointer_to really necessary ?
Yes. Just because our _Pointer_adapter allows implicit conversions
from raw pointers doesn't mean all fancy pointers allow that.
>Note that I also found a bug in the
>__gnu_test::CustomPointerAlloc::allocate, the signature with hint is
>wrong.
Yes, that's a bug, thanks.
>Â Â Â * include/ext/throw_allocator.h
>Â Â Â (annotate_base::insert(void*, size_t)): Use insert result to check for
>Â Â Â double insert attempt.
>Â Â Â (annotate_base::insert_construct(void*)): Likewise.
>Â Â Â (annotate_base::check_allocated(void*, size_t)): Return found iterator.
>Â Â Â (annotate_base::erase(void*, size_t)): Use latter method returned
>Â Â Â iterator.
>Â Â Â (annotate_base::check_constructed(void*, size_t)): Return found
>iterator.
>Â Â Â (annotate_base::erase_construct(void*)): Use latter method returned
>Â Â Â iterator.
This looks like the wrong ChangeLog.
>Â Â Â * libstdc++-v3/testsuite/util/testsuite_allocator.h
>Â Â Â (CustomPointerAlloc<>::allocate(size_t, pointer)): Replace by...
>Â Â Â (CustomPointerAlloc<>::allocate(size_t, const_void_pointer)): ...this.
>Â Â Â * testsuite/23_containers/unordered_set/allocator/ext_ptr.cc: Add
>Â Â Â check.
More information about the Libstdc++
mailing list