Conversation

Replying to and
Or accept using reference counting and dynamic mutability checks. Thread local reference counting is quite cheap, especially with default move semantics rather than implicitly adding new owners. People greatly exaggerate how often Rc/Weak and RefCell aren't a viable option.
1
2
This Tweet was deleted by the Tweet author. Learn more
This Tweet was deleted by the Tweet author. Learn more
The overhead isn't significantly larger on embedded. Rc<T> is quite cheap everywhere. It's thread-local and uses non-atomic counters. It adds 2 words to the allocation (one for weak pointers). There's no implicit reference counting like C++. Owning references are moved around.
1
1
Show replies