diff --git a/benchmark/DB_oindex.hh b/benchmark/DB_oindex.hh index b59f0910..9ec25ea1 100644 --- a/benchmark/DB_oindex.hh +++ b/benchmark/DB_oindex.hh @@ -773,7 +773,10 @@ protected: private: table_type table_; - uint64_t key_gen_; + union alignas(CACHE_LINE_SIZE) { + uint64_t key_gen_; + uint8_t _[CACHE_LINE_SIZE]; + }; static bool access_all(std::array& cell_accesses, std::array&, std::array&, internal_elem*) { // always_assert(false, "Not implemented."); diff --git a/benchmark/DB_uindex.hh b/benchmark/DB_uindex.hh index 8c4c75c9..8a3700b6 100644 --- a/benchmark/DB_uindex.hh +++ b/benchmark/DB_uindex.hh @@ -84,8 +84,10 @@ private: Hash hasher_; Pred pred_; - uint64_t key_gen_; - + union alignas(CACHE_LINE_SIZE) { + uint64_t key_gen_; + uint8_t _[CACHE_LINE_SIZE]; + }; // used to mark whether a key is a bucket (for bucket version checks) // or a pointer (which will always have the lower 3 bits as 0) static constexpr uintptr_t bucket_bit = C::item_key_tag; @@ -681,7 +683,10 @@ private: Hash hasher_; Pred pred_; - uint64_t key_gen_; + union alignas(CACHE_LINE_SIZE) { + uint64_t key_gen_; + uint8_t _[CACHE_LINE_SIZE]; + }; // used to mark whether a key is a bucket (for bucket version checks) // or a pointer (which will always have the lower 3 bits as 0)