This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: New hashtable power 2 rehash policy
- From: Daniel KrÃgler <daniel dot kruegler at gmail dot com>
- To: FranÃois Dumont <frs dot dumont at gmail dot com>
- Cc: Jonathan Wakely <jwakely at redhat dot com>, "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 14 May 2016 19:06:21 +0200
- Subject: Re: New hashtable power 2 rehash policy
- Authentication-results: sourceware.org; auth=none
- References: <571B31E1 dot 6000101 at gmail dot com> <20160428102218 dot GI4241 at redhat dot com> <57374EB6 dot 80301 at gmail dot com>
2016-05-14 18:13 GMT+02:00 FranÃois Dumont <frs.dumont@gmail.com>:
> New patch attached, tested under linux x86_64.
>
> FranÃois
1) The function __clp2 is declared using _GLIBCXX14_CONSTEXPR, which
means that it is an inline function if and *only* if
_GLIBCXX14_CONSTEXPR really expands to constexpr, otherwise it is
*not* inline, which is probably not intended and could easily cause
ODR problems. I suggest to mark it unconditionally as inline,
regardless of _GLIBCXX14_CONSTEXPR.
2) Furthermore I suggest to declare __clp2 as noexcept - this is
(intentionally) *not* implied by constexpr.
3) Is there any reason, why _Power2_rehash_policy::_M_next_bkt
shouldn't be noexcept?
4) Similar to (3) for _Power2_rehash_policy's member functions
_M_bkt_for_elements, _M_need_rehash, _M_state, _M_reset
- Daniel