libextra: Make arc::get and arc::new inline too.

Should be a 2x improvement in a Servo test case.
This commit is contained in:
Patrick Walton 2013-10-24 13:50:21 -07:00
parent 76287ccbb0
commit b13415cccc
1 changed files with 2 additions and 0 deletions

View File

@ -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() }
}