mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-13 20:26:03 +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 {
|
class Waiter {
|
||||||
friend class EventCount;
|
friend class EventCount;
|
||||||
// Align to 128 byte boundary to prevent false sharing with other Waiter
|
std::atomic<Waiter*> next;
|
||||||
// objects in the same vector.
|
|
||||||
EIGEN_ALIGN_TO_BOUNDARY(128) std::atomic<Waiter*> next;
|
|
||||||
std::mutex mu;
|
std::mutex mu;
|
||||||
std::condition_variable cv;
|
std::condition_variable cv;
|
||||||
uint64_t epoch;
|
uint64_t epoch;
|
||||||
@ -181,6 +179,9 @@ class EventCount {
|
|||||||
kWaiting,
|
kWaiting,
|
||||||
kSignaled,
|
kSignaled,
|
||||||
};
|
};
|
||||||
|
// Pad past 128 byte boundary to prevent false sharing with other Waiter
|
||||||
|
// objects in the same vector.
|
||||||
|
char pad_[128];
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user