diff --git a/folly/concurrency/CacheLocality.cpp b/folly/concurrency/CacheLocality.cpp index 20a71ed90c2..86be79ef252 100644 --- a/folly/concurrency/CacheLocality.cpp +++ b/folly/concurrency/CacheLocality.cpp @@ -500,7 +500,8 @@ class SimpleAllocator { allocator->freelist_ = ptr; } - constexpr static size_t kMallocAlign = 128; + constexpr static size_t kMallocAlign = + std::max(size_t(128), hardware_destructive_interference_size); static_assert( kMallocAlign % hardware_destructive_interference_size == 0, "Large allocations should be cacheline-aligned");