3 ms·
How do you know there are still references without counting them somewhere or inspecting all other objects? And what would the handler really do? What common
by rwmj 5y ago
How do you know there are still references without counting them somewhere or inspecting all other objects? And what would the handler really do? What common code has other owners willing to take over ownership (and you have to handle this problem recursively too).
- js8 5y agoIn the article, they already assume reference counting of references, see the previous paragraph: "When the reference goes out of scope, the count is reduced. When an owned value goes out of scope and its reference count is not zero, the program terminates with an error (which I'll refer to as a "panic")."