Use padding instead of alignment attribute, which MaxSizeVector does not respect. This leads to undefined behavior and hard-to-trace bugs.

This commit is contained in:
Rasmus Munk Larsen 2018-09-05 11:20:06 -07:00
parent 5927eef612
commit 8b3d9ed081

View File

@ -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: