diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-18 15:50:43 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-18 15:50:43 +0200 |
commit | 7debbd78596875619bf64af3b1a2406482be36a2 (patch) | |
tree | 21f6b638ff4e5de1b8b68472cec166b207c2f5a3 | |
parent | 075820ab23e70438ef26c9659126ad425b3f5de0 (diff) | |
download | mariadb-git-7debbd78596875619bf64af3b1a2406482be36a2.tar.gz |
Fix a compilation error
ib_counter_t::ib_counter_element_t: Avoid sizeof on a std::atomic type,
because it causes errors on some version of the Microsoft compiler.
-rw-r--r-- | storage/innobase/include/ut0counter.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/storage/innobase/include/ut0counter.h b/storage/innobase/include/ut0counter.h index e1a1d5614fe..4af3187ce76 100644 --- a/storage/innobase/include/ut0counter.h +++ b/storage/innobase/include/ut0counter.h @@ -108,14 +108,14 @@ struct ib_counter_t { private: /** Atomic which occupies whole CPU cache line */ - struct MY_ALIGNED(CACHE_LINE_SIZE) ib_counter_element_t { + union ib_counter_element_t { std::atomic<Type> value; - byte padding[CACHE_LINE_SIZE - sizeof(value)]; + byte padding[CACHE_LINE_SIZE]; }; static_assert(sizeof(ib_counter_element_t) == CACHE_LINE_SIZE, ""); /** Array of counter elements */ - ib_counter_element_t m_counter[N]; + MY_ALIGNED(CACHE_LINE_SIZE) ib_counter_element_t m_counter[N]; }; #endif /* ut0counter_h */ |