Crates.io | maybe_atomic_refcell |
lib.rs | maybe_atomic_refcell |
version | 0.3.1 |
source | src |
created_at | 2022-05-28 03:22:52.513812 |
updated_at | 2022-05-28 03:49:37.647194 |
description | AtomicRefcell for debug mode and UnsafeCell in release mode |
homepage | |
repository | https://github.com/finnbear/maybe_atomic_refcell/ |
max_upload_size | |
id | 595560 |
size | 13,183 |
AtomicRefCell
for debug
mode and UnsafeCell
in release
mode.
AtomicRefCell
performs an atomic memory access at runtime to validate borrowing. While
this is an excellent way to validate code and ensure safety, it is an expensive
operation. This crate delegates to AtomicRefCell
in debug
mode and uses UnsafeCell
to
emulate the same interface in release
mode, minus the runtime overhead.
safe
enables unconditional runtime checks, good for validating in release
modeborrow
and borrow_mut
are unsafe
(despite being safe in debug
mode)PartialEq
, Eq
, PartialOrd
, Ord
, etc. due to the aboveLicensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.