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

Use portable_atomic instead of atomic-polyfill #251

Merged
merged 6 commits into from Dec 7, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,10 @@

-

## 1.19.0

- Use `portable-atomic` instead of `atomic-polyfill`, [#251](https://github.com/matklad/once_cell/pull/251).

## 1.18.0

- `MSRV` is updated to 1.60.0 to take advantage of `dep:` syntax for cargo features,
Expand Down
19 changes: 8 additions & 11 deletions Cargo.lock.msrv

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "once_cell"
version = "1.18.0"
version = "1.19.0"
authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
Expand All @@ -21,7 +21,7 @@ members = ["xtask"]

[dependencies]
parking_lot_core = { version = "0.9.3", optional = true, default_features = false }
atomic-polyfill = { version = "1", optional = true }
portable-atomic = { version = "1", optional = true }
critical-section = { version = "1", optional = true }

[dev-dependencies]
Expand All @@ -48,7 +48,7 @@ parking_lot = ["dep:parking_lot_core"]
# Uses `critical-section` to implement `sync` and `race` modules. in
# `#![no_std]` mode. Please read `critical-section` docs carefully
# before enabling this feature.
critical-section = ["dep:critical-section", "dep:atomic-polyfill" ]
critical-section = ["dep:critical-section", "portable-atomic" ]

# Enables semver-exempt APIs of this crate.
# At the moment, this feature is unused.
Expand Down
2 changes: 1 addition & 1 deletion src/imp_cs.rs
@@ -1,6 +1,6 @@
use core::panic::{RefUnwindSafe, UnwindSafe};

use atomic_polyfill::{AtomicBool, Ordering};
use portable_atomic::{AtomicBool, Ordering};
use critical_section::{CriticalSection, Mutex};

use crate::unsync;
Expand Down
2 changes: 1 addition & 1 deletion src/race.rs
Expand Up @@ -20,7 +20,7 @@
//! architectures versus `Relaxed`.

#[cfg(feature = "critical-section")]
use atomic_polyfill as atomic;
use portable_atomic as atomic;
#[cfg(not(feature = "critical-section"))]
use core::sync::atomic;

Expand Down