From: Christopher Dykes Date: Thu, 4 Aug 2016 23:32:18 +0000 (-0700) Subject: Use std::max_align_t rather than __attribute__((__aligned__)) to get max alignment X-Git-Tag: v2016.08.08.00~7 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b22e53e035bce899409e19cf4f32d8b251758422;p=folly.git Use std::max_align_t rather than __attribute__((__aligned__)) to get max alignment Summary: Because the former is standardized, and the latter is a syntax error under MSVC. Reviewed By: yfeldblum Differential Revision: D3672667 fbshipit-source-id: c0149b11367e36ba5574625240c41a167348199f --- diff --git a/folly/test/ThreadCachedArenaTest.cpp b/folly/test/ThreadCachedArenaTest.cpp index 22ba1057..9332c739 100644 --- a/folly/test/ThreadCachedArenaTest.cpp +++ b/folly/test/ThreadCachedArenaTest.cpp @@ -30,6 +30,7 @@ #include #include +#include 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);