You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my own usage of servo_arc, I have come across a case where an object, when dropped, will remove itself from a collection. The collection owns a servo_arc::Arc<Thing>, and the user dropping the object is dropping another servo_arc::Arc<Thing>; so the object needs to remove itself from the collection if its reference count is 2, not if it's 1.
Unfortunately, servo_arc::Arc only provides is_unique(). Would it be possibly to add a reference_count(&self) -> usize method to servo_arc::Arc, analogous to std::sync::Arc's strong_count ?
The text was updated successfully, but these errors were encountered:
In my own usage of servo_arc, I have come across a case where an object, when dropped, will remove itself from a collection. The collection owns a
servo_arc::Arc<Thing>
, and the user dropping the object is dropping anotherservo_arc::Arc<Thing>
; so the object needs to remove itself from the collection if its reference count is 2, not if it's 1.Unfortunately,
servo_arc::Arc
only providesis_unique()
. Would it be possibly to add areference_count(&self) -> usize
method toservo_arc::Arc
, analogous tostd::sync::Arc
'sstrong_count
?The text was updated successfully, but these errors were encountered: