#atomic #integer #stable #unstable #compiler #compile #type

integer-atomics

This crate allows you to compile code that needs the unstable integer atomics types (Atomic{U,I}{8,16,32,64}) with the stable compiler

3 stable releases

Uses old Rust 2015

1.0.2 Mar 6, 2018
1.0.1 Jun 15, 2017

#2654 in Rust patterns

Download history 16/week @ 2024-02-18 31/week @ 2024-02-25 8/week @ 2024-03-03 19/week @ 2024-03-10 8/week @ 2024-03-17

70 downloads per month
Used in 2 crates (via futex)

MIT license

10KB
199 lines

This crate allows you to compile code that needs the unstable integer atomics types (Atomic{U,I}{8,16,32,64}) with the stable compiler.

If the nightly feature is enabled, it simply re-exports these types from std::sync::atomic.

Otherwise, they are emulated with the existing stable AtomicUsize and compare-exchange loops. Because of that, the Atomic{U,I}64 types are only available on 64-bit platforms. Also, this is obviously much slower than real atomics. This is only a stopgap solution until those are finally stabilized.

This crate has no documentation as these types are documented within the standard library docs.

No runtime deps

Features