maybeatomicrefcell

AtomicRefCell for debug mode and UnsafeCell in release mode.

Motivation

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.

Limitations

Licensed under either of

at your option.

Contribution

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.