mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-14 17:13:40 +00:00
[hash] Work around g++ bug?!
I kid you not. Revert this and see src/test-map loop forever eating your memory freezing your maching. In this loop: { hb_hashmap_t<int, int> m0; hb_hashmap_t<std::string, int> m1; hb_hashmap_t<int, std::string> m2; hb_hashmap_t<std::string, std::string> m3; std::string s; for (unsigned i = 1; i < 1000; i++) { s += "x"; m0.set (i, i); m1.set (s, i); m2.set (i, s); m3.set (s, s); } } i will not stop at 1000 and just keeps going. If you figure out what's going on, please enlighten me!
This commit is contained in:
parent
9fbab46f26
commit
075ecff750
1 changed files with 1 additions and 1 deletions
|
@ -317,7 +317,7 @@ struct
|
|||
// Horrible: std:hash() of integers seems to be identity in gcc / clang?!
|
||||
template <typename T,
|
||||
hb_enable_if (std::is_integral<T>::value)> constexpr auto
|
||||
impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, v * 8388607 /* Mersenne prime */)
|
||||
impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, v * 8388607u /* Mersenne prime */)
|
||||
|
||||
template <typename T> constexpr auto
|
||||
impl (const T& v, hb_priority<0>) const HB_RETURN (uint32_t, std::hash<hb_decay<decltype (hb_deref (v))>>{} (hb_deref (v)))
|
||||
|
|
Loading…
Add table
Reference in a new issue