libextra: Make arc clone inline
This commit is contained in:
parent
7075eb3625
commit
76287ccbb0
@ -148,6 +148,7 @@ impl<T:Freeze + Send> Clone for Arc<T> {
|
||||
* object. However, one of the `arc` objects can be sent to another task,
|
||||
* allowing them to share the underlying data.
|
||||
*/
|
||||
#[inline]
|
||||
fn clone(&self) -> Arc<T> {
|
||||
Arc { x: self.x.clone() }
|
||||
}
|
||||
@ -167,6 +168,7 @@ pub struct MutexArc<T> { priv x: UnsafeArc<MutexArcInner<T>> }
|
||||
|
||||
impl<T:Send> Clone for MutexArc<T> {
|
||||
/// Duplicate a mutex-protected Arc. See arc::clone for more details.
|
||||
#[inline]
|
||||
fn clone(&self) -> MutexArc<T> {
|
||||
// NB: Cloning the underlying mutex is not necessary. Its reference
|
||||
// count would be exactly the same as the shared state's.
|
||||
@ -349,6 +351,7 @@ pub struct RWArc<T> {
|
||||
|
||||
impl<T:Freeze + Send> Clone for RWArc<T> {
|
||||
/// Duplicate a rwlock-protected Arc. See arc::clone for more details.
|
||||
#[inline]
|
||||
fn clone(&self) -> RWArc<T> {
|
||||
RWArc { x: self.x.clone() }
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user