From 7d3bf47323694183b573d3e8b70b9a5fe973b587 Mon Sep 17 00:00:00 2001 From: Adenilson Cavalcanti Date: Thu, 26 Mar 2015 12:05:21 -0700 Subject: Adding more information about the behavior of Arc/Rc when you perform a clone() call. --- src/liballoc/arc.rs | 3 +++ src/liballoc/rc.rs | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/liballoc') diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index b5d16d29272..b012612af59 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -94,6 +94,9 @@ use heap::deallocate; /// With simple pipes, without `Arc`, a copy would have to be made for each /// task. /// +/// When you clone an `Arc`, it will create another pointer to the data and +/// increase the reference counter. +/// /// ``` /// # #![feature(alloc, core)] /// use std::sync::Arc; diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index eb3c5c16726..085042ce5a7 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -431,7 +431,8 @@ impl Clone for Rc { /// Makes a clone of the `Rc`. /// - /// This increases the strong reference count. + /// When you clone an `Rc`, it will create another pointer to the data and + /// increase the strong reference counter. /// /// # Examples /// -- cgit 1.4.1-3-g733a5