mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-27 07:29:52 +08:00
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:
parent
5927eef612
commit
8b3d9ed081
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user