[go: up one dir, main page]

portable-atomic 0.3.5

Portable atomic types including support for 128-bit atomics, atomic float, etc.
Documentation
[package]
name = "portable-atomic"
version = "0.3.5" #publish:version
edition = "2018"
rust-version = "1.34"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/taiki-e/portable-atomic"
keywords = ["atomic"]
categories = ["concurrency", "data-structures", "embedded", "hardware-support", "no-std"]
exclude = ["/.*", "/tools"]
description = """
Portable atomic types including support for 128-bit atomics, atomic float, etc.
"""

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
targets = ["x86_64-unknown-linux-gnu"]

[workspace]
members = [
    "bench",
    "tests/no-std",
]

[features]
default = ["fallback"]

# (enabled by default) Enable fallback implementations.
#
# Disabling this allows only atomic types for which the platform natively supports atomic operations.
fallback = []

# Enable run-time CPU feature detection.
#
# This allows maintaining support for older CPUs while using features that are not supported on older CPUs, such as cmpxchg16b (x86_64) and LSE (aarch64).
#
# Note:
# - Dynamic detection is currently only enabled in Rust 1.61+ for aarch64 and in nightly for other platforms, otherwise it works the same as the default.
# - If the required target features are enabled at compile-time, the atomic operations are inlined.
# - This is compatible with no-std (as with all features except `std`).
outline-atomics = []

# Provide `AtomicF{32,64}`.
# Note that most of `fetch_*` operations of atomic floats are implemented using CAS loops, which can be slower than equivalent operations of atomic integers.
float = []

# TODO
# # Provides generic `atomic<t>` type.
# generic = []

# Use `std`.
std = []

# Note: serde is public dependencies.
[dependencies]
# Implements serde::{Serialize,Deserialize} for atomic types.
#
# Note:
# - The MSRV when this feature enables depends on the MSRV of serde.
serde = { version = "1.0.103", optional = true, default-features = false }

[dev-dependencies]
crossbeam-utils = "0.8"
fastrand = "1"
paste = "1"
quickcheck = { default-features = false, git = "https://github.com/taiki-e/quickcheck.git", branch = "dev" } # https://github.com/BurntSushi/quickcheck/pull/304 + https://github.com/BurntSushi/quickcheck/pull/282 + lower MSRV
serde = { version = "1", features = ["derive"] }
serde_test = "1"
static_assertions = "1"