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
@ -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…
x
Reference in New Issue
Block a user