Atomic Reference-Strongly-Counted pointer
A replacement to Rust's std::sync::Arc when std::sync::Weak references is unneeded. Typically used to slightly decrease memory usage in memory-constrained environments.
Examples
Typical cloning and sending between threads.
use Arsc;
use thread;
let a = new;
let b = a.clone;
spawn;
Using as a receiver.
use Arsc;
;
Note
- Still need a global memory allocator. For environments where dynamic allocation is not supported, use some heapless structure instead.
- Be careful that
Arscis vulnerable to cyclic references! UseArcif those cases are possible. - This crate use some nightly-only features, so an up-to-date nightly toolchain is required to build this crate.