libextra: Make arc::get and arc::new inline too.
Should be a 2x improvement in a Servo test case.
This commit is contained in:
parent
76287ccbb0
commit
b13415cccc
@ -117,10 +117,12 @@ pub struct Arc<T> { priv x: UnsafeArc<T> }
|
||||
*/
|
||||
impl<T:Freeze+Send> Arc<T> {
|
||||
/// Create an atomically reference counted wrapper.
|
||||
#[inline]
|
||||
pub fn new(data: T) -> Arc<T> {
|
||||
Arc { x: UnsafeArc::new(data) }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get<'a>(&'a self) -> &'a T {
|
||||
unsafe { &*self.x.get_immut() }
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user