From: Phil Willoughby Date: Tue, 18 Jul 2017 10:14:07 +0000 (-0700) Subject: Relax alignment restriction in CachelinePadded X-Git-Tag: v2017.07.17.01~4 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d8c4d15e6b42836e29182f8c4438e2b9922011bb;p=folly.git Relax alignment restriction in CachelinePadded Summary: 32-bit iOS environments were triggering the previous condition with LifoSem. Reviewed By: yfeldblum Differential Revision: D5442057 fbshipit-source-id: 64ee32b4ad35150c7f295a2a30bbede8fa13e79e --- diff --git a/folly/CachelinePadded.h b/folly/CachelinePadded.h index 6e30b623..fe362a83 100644 --- a/folly/CachelinePadded.h +++ b/folly/CachelinePadded.h @@ -32,8 +32,8 @@ namespace folly { template class CachelinePadded { static_assert( - alignof(T) <= alignof(std::max_align_t), - "CachelinePadded does not support over-aligned types"); + alignof(T) < CacheLocality::kFalseSharingRange, + "CachelinePadded does not support types aligned >= a cache-line."); public: template @@ -66,8 +66,8 @@ class CachelinePadded { private: static constexpr size_t paddingSize() noexcept { - return folly::CacheLocality::kFalseSharingRange - - (alignof(T) % folly::CacheLocality::kFalseSharingRange); + return CacheLocality::kFalseSharingRange - + (alignof(T) % CacheLocality::kFalseSharingRange); } char paddingPre_[paddingSize()]; T inner_;