Skip to content

Commit 74d7a13

Browse files
committed
Add static_assert for deque age_t size
1 parent db12910 commit 74d7a13

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

include/dbscan/pbbs/scheduler.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ struct Deque {
7474
tag_t tag;
7575
qidx top;
7676
};
77+
// Catches layout issues at compile time on platforms where age_t is not exactly 8 bytes,
78+
// which would break the lock-free atomic CAS in the work-stealing deque.
79+
static_assert(sizeof(age_t) == sizeof(int64_t), "age_t must be 8 bytes for atomic CAS");
7780

7881
// align to avoid false sharing
7982
struct alignas(64) padded_job {

0 commit comments

Comments
 (0)