mirror of git://gcc.gnu.org/git/gcc.git
hashtable_policy.h (_Prime_rehash_policy::_S_n_primes): Delete.
2015-04-30 François Dumont <fdumont@gcc.gnu.org> * include/bits/hashtable_policy.h (_Prime_rehash_policy::_S_n_primes): Delete. * src/c++11/hashtable_c++0x.cc (_Prime_rehash_policy::_M_next_bkt): Remove usage of latter and compute size of the prime numbers array locally. From-SVN: r222611
This commit is contained in:
parent
2fc3c9a59b
commit
2f132d1d2c
|
|
@ -1,3 +1,11 @@
|
||||||
|
2015-04-30 François Dumont <fdumont@gcc.gnu.org>
|
||||||
|
|
||||||
|
* include/bits/hashtable_policy.h (_Prime_rehash_policy::_S_n_primes):
|
||||||
|
Delete.
|
||||||
|
* src/c++11/hashtable_c++0x.cc (_Prime_rehash_policy::_M_next_bkt):
|
||||||
|
Remove usage of latter and compute size of the prime numbers array
|
||||||
|
locally.
|
||||||
|
|
||||||
2015-04-29 Doug Evans <dje@google.com>
|
2015-04-29 Doug Evans <dje@google.com>
|
||||||
|
|
||||||
PR libstdc++/65839
|
PR libstdc++/65839
|
||||||
|
|
|
||||||
|
|
@ -495,8 +495,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
_M_reset(_State __state)
|
_M_reset(_State __state)
|
||||||
{ _M_next_resize = __state; }
|
{ _M_next_resize = __state; }
|
||||||
|
|
||||||
enum { _S_n_primes = sizeof(unsigned long) != 8 ? 256 : 256 + 48 };
|
|
||||||
|
|
||||||
static const std::size_t _S_growth_factor = 2;
|
static const std::size_t _S_growth_factor = 2;
|
||||||
|
|
||||||
float _M_max_load_factor;
|
float _M_max_load_factor;
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,10 @@ namespace __detail
|
||||||
return __fast_bkt[__n];
|
return __fast_bkt[__n];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr auto __n_primes
|
||||||
|
= sizeof(__prime_list) / sizeof(unsigned long) - 1;
|
||||||
const unsigned long* __next_bkt =
|
const unsigned long* __next_bkt =
|
||||||
std::lower_bound(__prime_list + 5, __prime_list + _S_n_primes, __n);
|
std::lower_bound(__prime_list + 5, __prime_list + __n_primes, __n);
|
||||||
_M_next_resize =
|
_M_next_resize =
|
||||||
__builtin_ceil(*__next_bkt * (long double)_M_max_load_factor);
|
__builtin_ceil(*__next_bkt * (long double)_M_max_load_factor);
|
||||||
return *__next_bkt;
|
return *__next_bkt;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue