@@ -117,10 +117,12 @@ pub struct Arc<T> { priv x: UnsafeArc<T> }
117
117
*/
118
118
impl < T : Freeze +Send > Arc < T > {
119
119
/// Create an atomically reference counted wrapper.
120
+ #[ inline]
120
121
pub fn new ( data : T ) -> Arc < T > {
121
122
Arc { x : UnsafeArc :: new ( data) }
122
123
}
123
124
125
+ #[ inline]
124
126
pub fn get < ' a > ( & ' a self ) -> & ' a T {
125
127
unsafe { & * self . x . get_immut ( ) }
126
128
}
@@ -148,6 +150,7 @@ impl<T:Freeze + Send> Clone for Arc<T> {
148
150
* object. However, one of the `arc` objects can be sent to another task,
149
151
* allowing them to share the underlying data.
150
152
*/
153
+ #[ inline]
151
154
fn clone ( & self ) -> Arc < T > {
152
155
Arc { x : self . x . clone ( ) }
153
156
}
@@ -167,6 +170,7 @@ pub struct MutexArc<T> { priv x: UnsafeArc<MutexArcInner<T>> }
167
170
168
171
impl < T : Send > Clone for MutexArc < T > {
169
172
/// Duplicate a mutex-protected Arc. See arc::clone for more details.
173
+ #[ inline]
170
174
fn clone ( & self ) -> MutexArc < T > {
171
175
// NB: Cloning the underlying mutex is not necessary. Its reference
172
176
// count would be exactly the same as the shared state's.
@@ -349,6 +353,7 @@ pub struct RWArc<T> {
349
353
350
354
impl < T : Freeze + Send > Clone for RWArc < T > {
351
355
/// Duplicate a rwlock-protected Arc. See arc::clone for more details.
356
+ #[ inline]
352
357
fn clone ( & self ) -> RWArc < T > {
353
358
RWArc { x : self . x . clone ( ) }
354
359
}
0 commit comments