diff --git a/monitoring/instrumented_mutex.h b/monitoring/instrumented_mutex.h index e05c6addd..ea29bb452 100644 --- a/monitoring/instrumented_mutex.h +++ b/monitoring/instrumented_mutex.h @@ -54,10 +54,9 @@ class InstrumentedMutex { class ALIGN_AS(CACHE_LINE_SIZE) CacheAlignedInstrumentedMutex : public InstrumentedMutex { using InstrumentedMutex::InstrumentedMutex; - char padding[(CACHE_LINE_SIZE - sizeof(InstrumentedMutex) % CACHE_LINE_SIZE) % - CACHE_LINE_SIZE] ROCKSDB_FIELD_UNUSED; }; -static_assert(sizeof(CacheAlignedInstrumentedMutex) % CACHE_LINE_SIZE == 0); +static_assert(alignof(CacheAlignedInstrumentedMutex) != CACHE_LINE_SIZE || + sizeof(CacheAlignedInstrumentedMutex) % CACHE_LINE_SIZE == 0); // RAII wrapper for InstrumentedMutex class InstrumentedMutexLock {