Loading RustViz Engine...
Simulate reference counter manipulation in Box, Rc, Arc, dynamic interior mutability with RefCell, and reference cycle prevention using Weak pointers.
Simulate heap allocation headers, atomic reference counters (Arc), and dynamic borrow tracking (RefCell).
| Pointer | Ownership | Thread Safety | Mutability | Runtime Cost |
|---|---|---|---|---|
| Box<T> | Unique (Single Owner) | Send + Sync (if T: Send + Sync) | Inherited from binding | Zero-cost (8B stack pointer) |
| Rc<T> | Shared (Ref-Counted) | !Send, !Sync (Single Thread) | Immutable | Cell increments (Non-atomic) |
| Arc<T> | Shared (Ref-Counted) | Send + Sync (Thread Safe) | Immutable | Atomic CPU fetch_add/sub |
| RefCell<T> | Interior Mutability | !Sync (Single Thread) | Dynamic runtime borrows | Borrow count integer check |
| Mutex<T> | Interior Mutability | Send + Sync (Multi Thread) | Exclusive Lock Guard | OS / Futex lock contention |