Commit d8c4d15e authored by Phil Willoughby's avatar Phil Willoughby Committed by Facebook Github Bot

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
parent 05e06a97
......@@ -32,8 +32,8 @@ namespace folly {
template <typename T>
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 <typename... Args>
......@@ -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_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment