Skip to content

Commit

Permalink
Merge pull request #251 from taks/portable-atomic
Browse files Browse the repository at this point in the history
Use `portable_atomic` instead of `atomic-polyfill`
  • Loading branch information
matklad committed Dec 7, 2023
2 parents 874f937 + 8211d80 commit c48d3c2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
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

0 comments on commit c48d3c2

Please sign in to comment.