mirror of
https://github.com/MariaDB/server.git
synced 2025-02-28 00:03:12 +01:00
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.
This commit is contained in:
parent
075820ab23
commit
7debbd7859
1 changed files with 3 additions and 3 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue