]> git.lizzy.rs Git - rust.git/commit
rollup merge of #19193: scialex/rc-counts
authorJakub Bukaj <jakub@jakub.cc>
Sun, 23 Nov 2014 19:11:50 +0000 (14:11 -0500)
committerJakub Bukaj <jakub@jakub.cc>
Sun, 23 Nov 2014 19:11:50 +0000 (14:11 -0500)
commit77d1f0b83ba8505d67532cb18be8d4c74a083cb4
treeb94b79a4814b6e9a8e08dd21c246c3403f8530d8
parent1e5de8cf3cde5f8cc7376c637d072b765c6403fe
parent69861df831a2d0c551b46a291c2530aeeab6c704
rollup merge of #19193: scialex/rc-counts

These functions allow you to see how many weak and strong references
there are to an `Arc`, `Rc`, or an `rc::Weak`. Due to the design of
`Arc` it is not possible to get the number of weak references of an
arbitrary `arc::Weak`. Look in `arc.rs` for a more in-depth explanation.

On `arc::Arc` and `arc::Weak` these operations are wait-free and atomic.

This sort of information is useful for creating dynamically cleared caches for use in OS development, for example holding pages of files in memory until the address space is needed for something else.