forked from mirror/async-std
Remove cache padding in channels
This commit is contained in:
parent
925b42bc89
commit
122e87364b
1 changed files with 5 additions and 5 deletions
|
@ -11,7 +11,7 @@ use std::sync::atomic::{self, AtomicUsize, Ordering};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::task::{Context, Poll};
|
use std::task::{Context, Poll};
|
||||||
|
|
||||||
use crossbeam_utils::{Backoff, CachePadded};
|
use crossbeam_utils::Backoff;
|
||||||
|
|
||||||
use crate::stream::Stream;
|
use crate::stream::Stream;
|
||||||
use crate::sync::WakerSet;
|
use crate::sync::WakerSet;
|
||||||
|
@ -577,7 +577,7 @@ struct Channel<T> {
|
||||||
/// represent the lap. The mark bit in the head is always zero.
|
/// represent the lap. The mark bit in the head is always zero.
|
||||||
///
|
///
|
||||||
/// Messages are popped from the head of the channel.
|
/// Messages are popped from the head of the channel.
|
||||||
head: CachePadded<AtomicUsize>,
|
head: AtomicUsize,
|
||||||
|
|
||||||
/// The tail of the channel.
|
/// The tail of the channel.
|
||||||
///
|
///
|
||||||
|
@ -586,7 +586,7 @@ struct Channel<T> {
|
||||||
/// represent the lap. The mark bit indicates that the channel is disconnected.
|
/// represent the lap. The mark bit indicates that the channel is disconnected.
|
||||||
///
|
///
|
||||||
/// Messages are pushed into the tail of the channel.
|
/// Messages are pushed into the tail of the channel.
|
||||||
tail: CachePadded<AtomicUsize>,
|
tail: AtomicUsize,
|
||||||
|
|
||||||
/// The buffer holding slots.
|
/// The buffer holding slots.
|
||||||
buffer: *mut Slot<T>,
|
buffer: *mut Slot<T>,
|
||||||
|
@ -660,8 +660,8 @@ impl<T> Channel<T> {
|
||||||
cap,
|
cap,
|
||||||
one_lap,
|
one_lap,
|
||||||
mark_bit,
|
mark_bit,
|
||||||
head: CachePadded::new(AtomicUsize::new(head)),
|
head: AtomicUsize::new(head),
|
||||||
tail: CachePadded::new(AtomicUsize::new(tail)),
|
tail: AtomicUsize::new(tail),
|
||||||
send_wakers: WakerSet::new(),
|
send_wakers: WakerSet::new(),
|
||||||
recv_wakers: WakerSet::new(),
|
recv_wakers: WakerSet::new(),
|
||||||
stream_wakers: WakerSet::new(),
|
stream_wakers: WakerSet::new(),
|
||||||
|
|
Loading…
Reference in a new issue