diff options
author | Rasmus Munk Larsen <rmlarsen@google.com> | 2018-09-05 11:20:06 -0700 |
---|---|---|
committer | Rasmus Munk Larsen <rmlarsen@google.com> | 2018-09-05 11:20:06 -0700 |
commit | 8b3d9ed081fc5d4870290649853b19cb5179546e (patch) | |
tree | f0b79365d7eaf2417d89a577dfcbaaa4a622661e | |
parent | 5927eef6127aae89abcc7f98e3a7ba66f6bdf56e (diff) |
Use padding instead of alignment attribute, which MaxSizeVector does not respect. This leads to undefined behavior and hard-to-trace bugs.
-rw-r--r-- | unsupported/Eigen/CXX11/src/ThreadPool/EventCount.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/unsupported/Eigen/CXX11/src/ThreadPool/EventCount.h b/unsupported/Eigen/CXX11/src/ThreadPool/EventCount.h index 22c952ae1..2cac2d0f1 100644 --- a/unsupported/Eigen/CXX11/src/ThreadPool/EventCount.h +++ b/unsupported/Eigen/CXX11/src/ThreadPool/EventCount.h @@ -169,9 +169,7 @@ class EventCount { class Waiter { friend class EventCount; - // Align to 128 byte boundary to prevent false sharing with other Waiter - // objects in the same vector. - EIGEN_ALIGN_TO_BOUNDARY(128) std::atomic<Waiter*> next; + std::atomic<Waiter*> next; std::mutex mu; std::condition_variable cv; uint64_t epoch; @@ -181,6 +179,9 @@ class EventCount { kWaiting, kSignaled, }; + // Pad past 128 byte boundary to prevent false sharing with other Waiter + // objects in the same vector. + char pad_[128]; }; private: |