diff --git a/include/boost/unordered/detail/foa.hpp b/include/boost/unordered/detail/foa.hpp index 31292a15..37ee4344 100644 --- a/include/boost/unordered/detail/foa.hpp +++ b/include/boost/unordered/detail/foa.hpp @@ -124,6 +124,10 @@ namespace foa{ * the first 64-bit word contain the least significant bits of each byte in the * "logical" 128-bit word, and so forth. With this layout, match can be * implemented with 4 ANDs, 3 shifts, 2 XORs, 1 OR and 1 NOT. + * + * group15 has no user-defined ctor so that it's a trivial type and can be + * initialized via memset etc. Where needed, group15::initialize sets the + * metadata to all zeros. */ #if defined(BOOST_UNORDERED_SSE2) @@ -137,6 +141,8 @@ struct group15 alignas(16) unsigned char storage[N+1]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0}; }; + inline void initialize(){m=_mm_setzero_si128();} + inline void set(std::size_t pos,std::size_t hash) { BOOST_ASSERT(pos(zero); + pg->initialize(); } arrays.groups[arrays.groups_size_mask].set_sentinel(); size_=0;