[patch] libstdc++/29988 Rb_Tree reuse allocated nodes

François Dumont frs.dumont@gmail.com
Tue Sep 23 19:58:00 GMT 2014


On 23/09/2014 13:22, Jonathan Wakely wrote:
> On 22/09/14 23:51 +0200, François Dumont wrote:
>> New patch in a couple of day then.
>
> OK, thanks.
>
It was faster than I though, here is the fixed patch tested under Linux 
x86_64.

2014-09-23  François Dumont  <fdumont@gcc.gnu.org>

     PR libstdc++/29988
     * include/bits/stl_tree.h (_Rb_tree_reuse_or_alloc_node<>): New.
     (_Rb_tree_alloc_node<>): New.
     (_Rb_tree<>::operator=(_Rb_tree<>&&)): New.
     (_Rb_tree<>::_M_assign_unique): New.
     (_Rb_tree<>::_M_assign_equal): New.
     (_Rb_tree<>): Adapt to reuse allocated nodes as much as possible.
     * include/bits/stl_map.h
     (std::map<>::operator=(std::map<>&&)): Default implementation.
     (std::map<>::operator=(initializer_list<>)): Adapt to use
     _Rb_tree::_M_assign_unique.
     * include/bits/stl_multimap.h
(std::multimap<>::operator=(std::multimap<>&&)): Default implementation.
     (std::multimap<>::operator=(initializer_list<>)): Adapt to use
     _Rb_tree::_M_assign_equal.
     * include/bits/stl_set.h
     (std::set<>::operator=(std::set<>&&)): Default implementation.
     (std::set<>::operator=(initializer_list<>)): Adapt to use
     _Rb_tree::_M_assign_unique.
     * include/bits/stl_multiset.h
(std::multiset<>::operator=(std::multiset<>&&)): Default implementation.
     (std::multiset<>::operator=(initializer_list<>)): Adapt to use
     _Rb_tree::_M_assign_equal.
     * testsuite/23_containers/map/allocator/copy_assign.cc (test03): New.
     * testsuite/23_containers/map/allocator/init-list.cc: New.
     * testsuite/23_containers/map/allocator/move_assign.cc (test03): New.
     * testsuite/23_containers/multimap/allocator/copy_assign.cc
     (test03): New.
     * testsuite/23_containers/multimap/allocator/init-list.cc: New.
     * testsuite/23_containers/multimap/allocator/move_assign.cc
     (test03): New.
     * testsuite/23_containers/multiset/allocator/copy_assign.cc
     (test03): New.
     * testsuite/23_containers/multiset/allocator/init-list.cc: New.
     * testsuite/23_containers/multiset/allocator/move_assign.cc
     (test03): New.
     * testsuite/23_containers/set/allocator/copy_assign.cc (test03): New.
     * testsuite/23_containers/set/allocator/init-list.cc: New.
     * testsuite/23_containers/set/allocator/move_assign.cc (test03): New.

Ok to commit ?

François
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tree.patch
Type: text/x-patch
Size: 46760 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140923/f636bbbf/attachment.bin>


More information about the Gcc-patches mailing list