7 ms·
I presume that “arc” means “automatic rc”. What’s manual rc like?
by avgcorrection 4y ago
I presume that “arc” means “automatic rc”.
What’s manual rc like?
- simiones 4y agoLike using std::shared_ptr<T> in C++ or Rc<T> (or Arc<T>, which in that case stands for atomic, not automatic) in Rust. That is, you as a programmer choose for which variables to use reference counting.
- nt591 4y agoYou can manually increment and decrement reference counts with retain/release: https://stackoverflow.com/questions/6578/understanding-reference-counting-with-cocoa-and-objective-c https://stackoverflow.com/questions/6578/understanding-refer...
- aidenn0 4y agohttps://docs.gtk.org/glib/reference-counting.html https://docs.gtk.org/glib/reference-counting.html
- deathanatos 4y agoNormally I'd read "arc" as "atomic reference count", i.e., a refcount system where the increment and decrement operations are done with atomic increments/decrements. This permits the refcounted objects to be shared across threads that might mutate the refcount: they need to not corrupt the refcount, or UB ensues. E.g., the Arc type in Rust. Rust, for example, has a separate Rc type. Rc should outperform Arc, but cannot be shared across threads.