From 459ff4cbc177681bb2269dd1ab3e97a2d9c434f4 Mon Sep 17 00:00:00 2001 From: Appelmans Date: Mon, 15 May 2023 10:41:08 -0700 Subject: [PATCH 1/2] build(deps): switch cache-padded to crossbeam-utils --- quic/s2n-quic-core/Cargo.toml | 4 ++-- quic/s2n-quic-core/src/sync/spsc/state.rs | 2 +- quic/s2n-quic-core/src/sync/worker.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/quic/s2n-quic-core/Cargo.toml b/quic/s2n-quic-core/Cargo.toml index 13a2423924..bf9104e3ea 100644 --- a/quic/s2n-quic-core/Cargo.toml +++ b/quic/s2n-quic-core/Cargo.toml @@ -12,7 +12,7 @@ exclude = ["corpus.tar.gz"] [features] default = ["alloc", "std"] -alloc = ["atomic-waker", "bytes", "cache-padded"] +alloc = ["atomic-waker", "bytes", "crossbeam-utils"] std = ["alloc", "once_cell"] testing = ["std", "generator", "s2n-codec/testing", "checked-counters", "insta", "futures-test"] generator = ["bolero-generator"] @@ -26,7 +26,7 @@ atomic-waker = { version = "1", optional = true } bolero-generator = { version = "0.9", optional = true } byteorder = { version = "1", default-features = false } bytes = { version = "1", optional = true, default-features = false } -cache-padded = { version = "1", optional = true } +crossbeam-utils = { version = "0.8", optional = true } cfg-if = "1" hex-literal = "0.4" # used for event snapshot testing - needs an internal API so we require a minimum version diff --git a/quic/s2n-quic-core/src/sync/spsc/state.rs b/quic/s2n-quic-core/src/sync/spsc/state.rs index 11447ff6e5..d6b6dd2fb0 100644 --- a/quic/s2n-quic-core/src/sync/spsc/state.rs +++ b/quic/s2n-quic-core/src/sync/spsc/state.rs @@ -4,7 +4,7 @@ use super::{Cell, ClosedError, Result, Slice}; use crate::sync::primitive::{AtomicBool, AtomicUsize, AtomicWaker, IsZst, Ordering}; use alloc::alloc::Layout; -use cache_padded::CachePadded; +use crossbeam_utils::CachePadded; use core::{ fmt, marker::PhantomData, diff --git a/quic/s2n-quic-core/src/sync/worker.rs b/quic/s2n-quic-core/src/sync/worker.rs index 54d1c60107..57cc1367b6 100644 --- a/quic/s2n-quic-core/src/sync/worker.rs +++ b/quic/s2n-quic-core/src/sync/worker.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use crate::sync::primitive::{Arc, AtomicUsize, AtomicWaker, Ordering}; -use cache_padded::CachePadded; +use crossbeam_utils::CachePadded; use core::{ future::Future, pin::Pin, From df5730b941ae27cebb533f94157b19a5edde2ff2 Mon Sep 17 00:00:00 2001 From: Appelmans Date: Mon, 15 May 2023 10:51:21 -0700 Subject: [PATCH 2/2] fmt --- quic/s2n-quic-core/src/sync/spsc/state.rs | 2 +- quic/s2n-quic-core/src/sync/worker.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/quic/s2n-quic-core/src/sync/spsc/state.rs b/quic/s2n-quic-core/src/sync/spsc/state.rs index d6b6dd2fb0..a69c8b72e5 100644 --- a/quic/s2n-quic-core/src/sync/spsc/state.rs +++ b/quic/s2n-quic-core/src/sync/spsc/state.rs @@ -4,7 +4,6 @@ use super::{Cell, ClosedError, Result, Slice}; use crate::sync::primitive::{AtomicBool, AtomicUsize, AtomicWaker, IsZst, Ordering}; use alloc::alloc::Layout; -use crossbeam_utils::CachePadded; use core::{ fmt, marker::PhantomData, @@ -12,6 +11,7 @@ use core::{ panic::{RefUnwindSafe, UnwindSafe}, ptr::NonNull, }; +use crossbeam_utils::CachePadded; type Pair<'a, T> = super::Pair>>; diff --git a/quic/s2n-quic-core/src/sync/worker.rs b/quic/s2n-quic-core/src/sync/worker.rs index 57cc1367b6..ed6ef8fce8 100644 --- a/quic/s2n-quic-core/src/sync/worker.rs +++ b/quic/s2n-quic-core/src/sync/worker.rs @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 use crate::sync::primitive::{Arc, AtomicUsize, AtomicWaker, Ordering}; -use crossbeam_utils::CachePadded; use core::{ future::Future, pin::Pin, task::{Context, Poll}, }; +use crossbeam_utils::CachePadded; /// Creates a worker channel with a Sender and Receiver pub fn channel() -> (Sender, Receiver) {