Use std::max_align_t rather than __attribute__((__aligned__)) to get max alignment
[folly.git] / folly / test / ThreadCachedArenaTest.cpp
index 22ba10577bfe35fe272a15e6885269bb0749710b..9332c7397edd5059b4a5d97924e2ca2b0fa7d2c3 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <folly/Range.h>
 #include <folly/Benchmark.h>
+#include <folly/Portability.h>
 
 using namespace folly;
 
@@ -94,8 +95,7 @@ void ArenaTester::merge(ArenaTester&& other) {
 }  // namespace
 
 TEST(ThreadCachedArena, BlockSize) {
-  struct Align { char c; } __attribute__((__aligned__));
-  static const size_t alignment = alignof(Align);
+  static const size_t alignment = alignof(std::max_align_t);
   static const size_t requestedBlockSize = 64;
 
   ThreadCachedArena arena(requestedBlockSize);