Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.8: Prepare for the next release #1086

Merged
merged 5 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
name = "crossbeam"
# When publishing a new version:
# - Update CHANGELOG.md
# - Update README.md
# - Create "crossbeam-X.Y.Z" git tag
# - Update README.md (when increasing major or minor version)
# - Run './tools/publish.sh crossbeam <version>'
version = "0.8.4"
edition = "2021"
rust-version = "1.61"
Expand Down
4 changes: 4 additions & 0 deletions crossbeam-channel/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Version 0.5.12

- Fix memory leak in unbounded channel. (#1084)

# Version 0.5.11

- Remove dependency on `cfg-if`. (#1072)
Expand Down
6 changes: 3 additions & 3 deletions crossbeam-channel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
name = "crossbeam-channel"
# When publishing a new version:
# - Update CHANGELOG.md
# - Update README.md
# - Create "crossbeam-channel-X.Y.Z" git tag
version = "0.5.11"
# - Update README.md (when increasing major or minor version)
# - Run './tools/publish.sh crossbeam-channel <version>'
version = "0.5.12"
edition = "2021"
rust-version = "1.60"
license = "MIT OR Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion crossbeam-channel/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl Context {
where
F: FnOnce(&Context) -> R,
{
thread_local! {
std::thread_local! {
/// Cached thread-local context.
static CONTEXT: Cell<Option<Context>> = Cell::new(Some(Context::new()));
}
Expand Down
1 change: 1 addition & 0 deletions crossbeam-channel/src/counter.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Reference counter for channels.

use std::boxed::Box;
use std::isize;
use std::ops;
use std::process;
Expand Down
1 change: 1 addition & 0 deletions crossbeam-channel/src/flavors/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
//! - <http://www.1024cores.net/home/lock-free-algorithms/queues/bounded-mpmc-queue>
//! - <https://docs.google.com/document/d/1yIAYmbvL3JxOKOjuCyon7JhW4cSv1wy5hC0ApeGMV9s/pub>

use std::boxed::Box;
use std::cell::UnsafeCell;
use std::mem::{self, MaybeUninit};
use std::ptr;
Expand Down
5 changes: 3 additions & 2 deletions crossbeam-channel/src/flavors/list.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Unbounded channel implemented as a linked list.

use std::boxed::Box;
use std::cell::UnsafeCell;
use std::marker::PhantomData;
use std::mem::MaybeUninit;
Expand Down Expand Up @@ -582,7 +583,7 @@ impl<T> Channel<T> {
}

let mut head = self.head.index.load(Ordering::Acquire);
let mut block = self.head.block.load(Ordering::Acquire);
let mut block = self.head.block.swap(ptr::null_mut(), Ordering::AcqRel);

// If we're going to be dropping messages we need to synchronize with initialization
if head >> SHIFT != tail >> SHIFT {
Expand All @@ -595,6 +596,7 @@ impl<T> Channel<T> {
block = self.head.block.load(Ordering::Acquire);
}
}

unsafe {
// Drop all messages between head and tail and deallocate the heap-allocated blocks.
while head >> SHIFT != tail >> SHIFT {
Expand Down Expand Up @@ -622,7 +624,6 @@ impl<T> Channel<T> {
}
}
head &= !MARK_BIT;
self.head.block.store(ptr::null_mut(), Ordering::Release);
self.head.index.store(head, Ordering::Release);
}

Expand Down
1 change: 1 addition & 0 deletions crossbeam-channel/src/flavors/zero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//!
//! This kind of channel is also known as *rendezvous* channel.

use std::boxed::Box;
use std::cell::UnsafeCell;
use std::marker::PhantomData;
use std::sync::atomic::{AtomicBool, Ordering};
Expand Down
5 changes: 4 additions & 1 deletion crossbeam-channel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@
//! [`iter`]: Receiver::iter
//! [`try_iter`]: Receiver::try_iter

#![no_std]
#![doc(test(
no_crate_inject,
attr(
Expand All @@ -334,7 +335,9 @@
rust_2018_idioms,
unreachable_pub
)]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(feature = "std")]
extern crate std;

#[cfg(feature = "std")]
mod channel;
Expand Down
1 change: 1 addition & 0 deletions crossbeam-channel/src/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::fmt;
use std::marker::PhantomData;
use std::mem;
use std::time::{Duration, Instant};
use std::vec::Vec;

use crossbeam_utils::Backoff;

Expand Down
2 changes: 1 addition & 1 deletion crossbeam-channel/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub(crate) fn shuffle<T>(v: &mut [T]) {
return;
}

thread_local! {
std::thread_local! {
static RNG: Cell<Wrapping<u32>> = const { Cell::new(Wrapping(1_406_868_647)) };
}

Expand Down
3 changes: 2 additions & 1 deletion crossbeam-channel/src/waker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::ptr;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Mutex;
use std::thread::{self, ThreadId};
use std::vec::Vec;

use crate::context::Context;
use crate::select::{Operation, Selected};
Expand Down Expand Up @@ -275,7 +276,7 @@ impl Drop for SyncWaker {
/// Returns the id of the current thread.
#[inline]
fn current_thread_id() -> ThreadId {
thread_local! {
std::thread_local! {
/// Cached thread-local id.
static THREAD_ID: ThreadId = thread::current().id();
}
Expand Down
3 changes: 1 addition & 2 deletions crossbeam-channel/tests/mpsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ mod channel_tests {

use std::env;
use std::thread;
use std::time::{Duration, Instant};
use std::time::Instant;

pub fn stress_factor() -> usize {
match env::var("RUST_TEST_STRESS") {
Expand Down Expand Up @@ -969,7 +969,6 @@ mod sync_channel_tests {

use std::env;
use std::thread;
use std::time::Duration;

pub fn stress_factor() -> usize {
match env::var("RUST_TEST_STRESS") {
Expand Down
4 changes: 2 additions & 2 deletions crossbeam-deque/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
name = "crossbeam-deque"
# When publishing a new version:
# - Update CHANGELOG.md
# - Update README.md
# - Create "crossbeam-deque-X.Y.Z" git tag
# - Update README.md (when increasing major or minor version)
# - Run './tools/publish.sh crossbeam-deque <version>'
version = "0.8.5"
edition = "2021"
rust-version = "1.61"
Expand Down
1 change: 1 addition & 0 deletions crossbeam-deque/src/deque.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::boxed::Box;
use std::cell::{Cell, UnsafeCell};
use std::cmp;
use std::fmt;
Expand Down
5 changes: 4 additions & 1 deletion crossbeam-deque/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
//! [`steal_batch()`]: Stealer::steal_batch
//! [`steal_batch_and_pop()`]: Stealer::steal_batch_and_pop

#![no_std]
#![doc(test(
no_crate_inject,
attr(
Expand All @@ -95,7 +96,9 @@
rust_2018_idioms,
unreachable_pub
)]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(feature = "std")]
extern crate std;

#[cfg(feature = "std")]
mod deque;
Expand Down
4 changes: 2 additions & 2 deletions crossbeam-epoch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
name = "crossbeam-epoch"
# When publishing a new version:
# - Update CHANGELOG.md
# - Update README.md
# - Create "crossbeam-epoch-X.Y.Z" git tag
# - Update README.md (when increasing major or minor version)
# - Run './tools/publish.sh crossbeam-epoch <version>'
version = "0.9.18"
edition = "2021"
rust-version = "1.61"
Expand Down
1 change: 1 addition & 0 deletions crossbeam-epoch/src/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ impl fmt::Debug for LocalHandle {
mod tests {
use std::mem::ManuallyDrop;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::vec::Vec;

use crossbeam_utils::thread;

Expand Down
2 changes: 1 addition & 1 deletion crossbeam-epoch/src/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ mod tests {
}
}

thread_local! {
std::thread_local! {
static FOO: Foo = const { Foo };
}

Expand Down
3 changes: 3 additions & 0 deletions crossbeam-epoch/src/deferred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,11 @@ impl Deferred {
#[cfg(all(test, not(crossbeam_loom)))]
mod tests {
use super::Deferred;
use std::boxed::Box;
use std::cell::Cell;
use std::convert::identity;
use std::string::ToString;
use std::vec;

#[test]
fn on_stack() {
Expand Down
2 changes: 1 addition & 1 deletion crossbeam-epoch/src/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ impl IsElement<Self> for Local {

#[cfg(all(test, not(crossbeam_loom)))]
mod tests {
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::atomic::AtomicUsize;

use super::*;

Expand Down
4 changes: 3 additions & 1 deletion crossbeam-epoch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
//! For majority of use cases, just use the default garbage collector by invoking [`pin`]. If you
//! want to create your own garbage collector, use the [`Collector`] API.

#![no_std]
#![doc(test(
no_crate_inject,
attr(
Expand All @@ -61,10 +62,11 @@
rust_2018_idioms,
unreachable_pub
)]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(crossbeam_loom)]
extern crate loom_crate as loom;
#[cfg(feature = "std")]
extern crate std;

#[cfg(crossbeam_loom)]
#[allow(unused_imports, dead_code)]
Expand Down
1 change: 1 addition & 0 deletions crossbeam-epoch/src/sync/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ mod tests {
use crate::{Collector, Owned};
use crossbeam_utils::thread;
use std::sync::Barrier;
use std::vec::Vec;

impl IsElement<Entry> for Entry {
fn entry_of(entry: &Entry) -> &Entry {
Expand Down
1 change: 1 addition & 0 deletions crossbeam-epoch/src/sync/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ mod test {
use super::*;
use crate::pin;
use crossbeam_utils::thread;
use std::vec;

struct Queue<T> {
queue: super::Queue<T>,
Expand Down
4 changes: 2 additions & 2 deletions crossbeam-queue/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
name = "crossbeam-queue"
# When publishing a new version:
# - Update CHANGELOG.md
# - Update README.md
# - Create "crossbeam-queue-X.Y.Z" git tag
# - Update README.md (when increasing major or minor version)
# - Run './tools/publish.sh crossbeam-queue <version>'
version = "0.3.11"
edition = "2021"
rust-version = "1.60"
Expand Down
4 changes: 3 additions & 1 deletion crossbeam-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//! * [`ArrayQueue`], a bounded MPMC queue that allocates a fixed-capacity buffer on construction.
//! * [`SegQueue`], an unbounded MPMC queue that allocates small buffers, segments, on demand.

#![no_std]
#![doc(test(
no_crate_inject,
attr(
Expand All @@ -18,10 +19,11 @@
rust_2018_idioms,
unreachable_pub
)]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(all(feature = "alloc", target_has_atomic = "ptr"))]
extern crate alloc;
#[cfg(feature = "std")]
extern crate std;

#[cfg(all(feature = "alloc", target_has_atomic = "ptr"))]
mod array_queue;
Expand Down
4 changes: 2 additions & 2 deletions crossbeam-skiplist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
name = "crossbeam-skiplist"
# When publishing a new version:
# - Update CHANGELOG.md
# - Update README.md
# - Create "crossbeam-skiplist-X.Y.Z" git tag
# - Update README.md (when increasing major or minor version)
# - Run './tools/publish.sh crossbeam-skiplist <version>'
version = "0.0.0"
edition = "2021"
rust-version = "1.61"
Expand Down
4 changes: 3 additions & 1 deletion crossbeam-skiplist/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@
//! }
//! ```

#![no_std]
#![doc(test(
no_crate_inject,
attr(
Expand All @@ -241,10 +242,11 @@
rust_2018_idioms,
unreachable_pub
)]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(all(feature = "alloc", target_has_atomic = "ptr"))]
extern crate alloc;
#[cfg(feature = "std")]
extern crate std;

#[cfg(all(feature = "alloc", target_has_atomic = "ptr"))]
pub mod base;
Expand Down
4 changes: 2 additions & 2 deletions crossbeam-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
name = "crossbeam-utils"
# When publishing a new version:
# - Update CHANGELOG.md
# - Update README.md
# - Create "crossbeam-utils-X.Y.Z" git tag
# - Update README.md (when increasing major or minor version)
# - Run './tools/publish.sh crossbeam-utils <version>'
version = "0.8.19"
edition = "2021"
rust-version = "1.60"
Expand Down
5 changes: 4 additions & 1 deletion crossbeam-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
//! [`WaitGroup`]: sync::WaitGroup
//! [`scope`]: thread::scope

#![no_std]
#![doc(test(
no_crate_inject,
attr(
Expand All @@ -37,7 +38,9 @@
rust_2018_idioms,
unreachable_pub
)]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(feature = "std")]
extern crate std;

#[cfg(crossbeam_loom)]
#[allow(unused_imports)]
Expand Down
Loading