Optimize hashtable allocator

François Dumont frs.dumont@gmail.com
Tue Oct 30 21:02:00 GMT 2012


Hi

     Here is a proposal to introduce EBO for hashtable allocator. I 
combined it with the before begin node in a small dedicated struct. 
According latest messages I understood it was still time to break ABI 
for unordered containers, at least I hope so.

     I try to adapt pretty printer code but haven't been able to test it 
as I don't have the necessary gdb version and don't have time to update 
it at the moment. If you prefer I can leave it untouched. By the way, 
there is suspect code in it. It tries to deal with std and std::tr1 
unordered containers through the same python code but it won't work 
anymore for iterators. They are different in std and tr1 modes so there 
are adaptations missing if we still want to support both versions.

2012-09-29  François Dumont  <fdumont@gcc.gnu.org>

     * include/bits/hashtable_policy.h (__details::_Before_begin<>):
     New, combine a base node instance and an allocator.
     * include/bits/hashtable.h (_Hashtable<>::_M_node_allocator): Remove.
     (_Hashtable<>::_M_before_begin): Rename into _M_bbegin and type
     modified to __detail::_Before_begin<>.
     (_Hashtable<>::_M_node_allocator()): New, get the node allocator
     part of _M_bbegin.
     (_Hashtable<>::_M_before_begin()): New, get the before begin node
     part of _M_bbegin.
     (_Hashtable<>): Adapt to use latter.
     * python/libstdcxx/v6/printers.py (Tr1HashtableIterator): Adapt.

Tested under Linux x86_64.

Ok to commit ?

François

-------------- next part --------------
A non-text attachment was scrubbed...
Name: hashtable.patch
Type: text/x-patch
Size: 11191 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20121030/4d4d6859/attachment.bin>


More information about the Libstdc++ mailing list