This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Optimize hashtable allocator
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: François Dumont <frs dot dumont at gmail dot com>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Tue, 30 Oct 2012 21:26:31 +0000
- Subject: Re: Optimize hashtable allocator
- References: <50904047.1060702@gmail.com>
Please include gcc-patches on patch proposals, not just with an email
to say what's eventually committed, thanks.
On 30 October 2012 21:01, François Dumont wrote:
> Hi
>
> Here is a proposal to introduce EBO for hashtable allocator. I combined
> it with the before begin node in a small dedicated struct.
Great, thanks.
> According latest
> messages I understood it was still time to break ABI for unordered
> containers, at least I hope so.
Paolo?
> 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.
Please try to install a newer GDB, building it is as simple as
./configure --prefix=PREFIX && make install and takes a few minutes.
You need GDB 7.x for GCC 4.7 anyway, which would also be new enough to
test the pretty printers. Either test the changes or don't change the
printers.
> 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.
Yes we want to support both.
Can the difference between the iterators be handled easily the same
way I changed the printers to use _M_h when necessary, or should be
just have separate StdHashtableIterator and Tr1HashtableIterator
printers?
> 2012-09-29 François Dumont <fdumont@gcc.gnu.org>
2012-10 :)
+
+ template<typename _Alloc>
+ _Before_begin(_Alloc __a)
+ : _NodeAlloc(__a)
+ { }
Can this use a "universal reference" (to use Scott Meyers's term) to
avoid a copy?
template<typename _Alloc>
_Before_begin(_Alloc&& __a)
: _NodeAlloc(std::forward<_Alloc>(__a))
{ }
There's no need to use Doxygen for _Before_begin, it's not for end users.