▲ | gmueckl 2 days ago | |||||||
You have to realize that the number of locations in code where reference counter adjustment is actually meaningful is rather small and there are simple rules to keep the excess thrash from reference counting pointer wrappers to a minimum. The main one, as mentioned in the talk the sibling comment called out, is that it is OK to pass a raw pointer or reference to a function while holding on to a reference count for as long as that other function runs (and doesn't leak the pointer through a side effect). This rule catches a lot of pointless counter arithmetic through excessive pointer wrapper copying. | ||||||||
▲ | silon42 2 days ago | parent [-] | |||||||
Maybe C++ should copy some Swift, before attempting to challenge Rust. | ||||||||
|