From d8c4d15e6b42836e29182f8c4438e2b9922011bb Mon Sep 17 00:00:00 2001 From: Phil Willoughby Date: Tue, 18 Jul 2017 03:14:07 -0700 Subject: [PATCH] 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 --- folly/CachelinePadded.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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_; -- 2.34.1