Skip to content

Commit

Permalink
Remove redundant padding
Browse files Browse the repository at this point in the history
As suggested by @Philippe91 in #30
  • Loading branch information
rigtorp committed Sep 25, 2023
1 parent 4066113 commit 1053918
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions include/rigtorp/SPSCQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,5 @@ template <typename T, typename Allocator = std::allocator<T>> class SPSCQueue {
alignas(kCacheLineSize) size_t readIdxCache_ = 0;
alignas(kCacheLineSize) std::atomic<size_t> readIdx_ = {0};
alignas(kCacheLineSize) size_t writeIdxCache_ = 0;

// Padding to avoid adjacent allocations to share cache line with
// writeIdxCache_
char padding_[kCacheLineSize - sizeof(writeIdxCache_)];
};
} // namespace rigtorp

0 comments on commit 1053918

Please sign in to comment.