This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Optimize hashtable allocator


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]