This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3] fix libstdc++/52446
- 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, 13 Mar 2012 21:50:35 +0000
- Subject: Re: [v3] fix libstdc++/52446
- References: <4F5FBDE6.4010407@gmail.com>
On 13 March 2012 21:36, François Dumont wrote:
> Hi
>
> ? ?Here a patch proposition to fix PR 52446.
Great, thanks, I'll have a look asap.
> ? ?I have introduce 2 version of the _M_rehash method. One used when keys
> are unique which is very close to the existing one. The second that take
> care of keeping equivalent keys relative order on rehash. The second one
> might seem complicated but I wanted to avoid to recompute a bucket index
> each time we find an equivalent element. If the hash code is cached it is ok
> but if it is not I prefer to limit the number of time it is recalculated.
>
> 2012-03-13 ?François Dumont <fdumont@gcc.gnu.org>
>
> ? ?PR libstdc++/52446
Should be 52476
> ? ?* include/bits/hashtable.h (_Hashtable<>::_M_rehash): Split into 2
> ? ?methods, the first, copy of the existing one, is used when keys
> ? ?are unique, the second purpose is to keep equivalent keys relative
> ? ?orders.
There are no methods in C++, only member functions :-)
I would say "Add overload for non-unique keys that preserves order of
equivalent keys"
> methods, the first, copy of the existing one, is used when keys
> are unique, the second purpose is to keep equivalent keys relative
> orders.
> ? ?* testsuite/23_containers/unordered_multimap/insert/52446.cc: New.
>
> Tested under linux x86_64.
>
> If ok tell me if I must also apply it to 4.7 branch.
Assuming it's OK for 4.8.0 (I'll review later) then definitely not
until after 4.7.0 is released and the branch is unfrozen. Even then
it should probably stay on trunk for a while to be tested, before
deciding whether to also apply it to the branch for 4.7.1