From 122e87364bef463c5afbf7681ec3ce35a3a7f577 Mon Sep 17 00:00:00 2001 From: Stjepan Glavina Date: Sat, 9 Nov 2019 23:07:26 +0100 Subject: [PATCH] Remove cache padding in channels --- src/sync/channel.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sync/channel.rs b/src/sync/channel.rs index dc7bee1..392c851 100644 --- a/src/sync/channel.rs +++ b/src/sync/channel.rs @@ -11,7 +11,7 @@ use std::sync::atomic::{self, AtomicUsize, Ordering}; use std::sync::Arc; use std::task::{Context, Poll}; -use crossbeam_utils::{Backoff, CachePadded}; +use crossbeam_utils::Backoff; use crate::stream::Stream; use crate::sync::WakerSet; @@ -577,7 +577,7 @@ struct Channel { /// represent the lap. The mark bit in the head is always zero. /// /// Messages are popped from the head of the channel. - head: CachePadded, + head: AtomicUsize, /// The tail of the channel. /// @@ -586,7 +586,7 @@ struct Channel { /// represent the lap. The mark bit indicates that the channel is disconnected. /// /// Messages are pushed into the tail of the channel. - tail: CachePadded, + tail: AtomicUsize, /// The buffer holding slots. buffer: *mut Slot, @@ -660,8 +660,8 @@ impl Channel { cap, one_lap, mark_bit, - head: CachePadded::new(AtomicUsize::new(head)), - tail: CachePadded::new(AtomicUsize::new(tail)), + head: AtomicUsize::new(head), + tail: AtomicUsize::new(tail), send_wakers: WakerSet::new(), recv_wakers: WakerSet::new(), stream_wakers: WakerSet::new(),