suppress warnings in tests for deprecated functions
[folly.git] / folly / MicroSpinLock.h
index d0c9ac23a19562c69aabd54d4757a56a2684549b..17d181f79dc2dfee75cd9430e21aa5c676d6b532 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2015-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -45,7 +45,8 @@
 #include <type_traits>
 
 #include <folly/Portability.h>
-#include <folly/detail/Sleeper.h>
+#include <folly/lang/Align.h>
+#include <folly/synchronization/detail/Sleeper.h>
 
 namespace folly {
 
@@ -118,7 +119,7 @@ static_assert(
 #define FOLLY_CACHE_LINE_SIZE 64
 
 template <class T, size_t N>
-struct FOLLY_ALIGNED_MAX SpinLockArray {
+struct alignas(max_align_v) SpinLockArray {
   T& operator[](size_t i) {
     return data_[i].lock;
   }
@@ -140,9 +141,8 @@ struct FOLLY_ALIGNED_MAX SpinLockArray {
 
   // Check if T can theoretically cross a cache line.
   static_assert(
-      folly::max_align_v > 0 &&
-          FOLLY_CACHE_LINE_SIZE % folly::max_align_v == 0 &&
-          sizeof(T) <= folly::max_align_v,
+      max_align_v > 0 && FOLLY_CACHE_LINE_SIZE % max_align_v == 0 &&
+          sizeof(T) <= max_align_v,
       "T can cross cache line boundaries");
 
   char padding_[FOLLY_CACHE_LINE_SIZE];
@@ -155,4 +155,4 @@ typedef std::lock_guard<MicroSpinLock> MSLGuard;
 
 //////////////////////////////////////////////////////////////////////
 
-}
+} // namespace folly