+2018-12-23 François Dumont <fdumont@gcc.gnu.org>
+
+ Respect pointer_traits on node deallocation in _ReuseOrAllocNode
+ parenthesis operator.
+
+ * include/bits/hashtable_policy.h
+ (_Hashtable_alloc<>::_M_deallocate_node_ptr(__node_type*)): New.
+ (_Hashtable_alloc<>::_M_deallocate_node(__node_type*)): Use latter.
+ (_ReuseOrAllocNode<>::operator<_Arg>()(_Arg&&)): Likewise.
+
2018-12-22 Iain Sandoe <iain@sandoe.co.uk>
* /config/os/bsd/darwin/ppc-extra.ver: Append long double symbols.
}
__catch(...)
{
- __node->~__node_type();
- __node_alloc_traits::deallocate(__a, __node, 1);
+ _M_h._M_deallocate_node_ptr(__node);
__throw_exception_again;
}
return __node;
void
_M_deallocate_node(__node_type* __n);
+ void
+ _M_deallocate_node_ptr(__node_type* __n);
+
// Deallocate the linked list of nodes pointed to by __n
void
_M_deallocate_nodes(__node_type* __n);
template<typename _NodeAlloc>
void
_Hashtable_alloc<_NodeAlloc>::_M_deallocate_node(__node_type* __n)
+ {
+ __node_alloc_traits::destroy(_M_node_allocator(), __n->_M_valptr());
+ _M_deallocate_node_ptr(__n);
+ }
+
+ template<typename _NodeAlloc>
+ void
+ _Hashtable_alloc<_NodeAlloc>::_M_deallocate_node_ptr(__node_type* __n)
{
typedef typename __node_alloc_traits::pointer _Ptr;
auto __ptr = std::pointer_traits<_Ptr>::pointer_to(*__n);
- __node_alloc_traits::destroy(_M_node_allocator(), __n->_M_valptr());
__n->~__node_type();
__node_alloc_traits::deallocate(_M_node_allocator(), __ptr, 1);
}