diff --git a/src/libcore/unsafe.rs b/src/libcore/unsafe.rs index f945cb8ad1d8..22cdbacd60f5 100644 --- a/src/libcore/unsafe.rs +++ b/src/libcore/unsafe.rs @@ -105,6 +105,7 @@ unsafe fn shared_mutable_state(+data: T) -> SharedMutableState { } } +#[inline(always)] unsafe fn get_shared_mutable_state(rc: &SharedMutableState) -> &mut T { unsafe { @@ -116,6 +117,7 @@ unsafe fn get_shared_mutable_state(rc: &SharedMutableState) return r; } } +#[inline(always)] unsafe fn get_shared_immutable_state(rc: &SharedMutableState) -> &T { unsafe { @@ -169,6 +171,7 @@ class LittleLock { } impl LittleLock { + #[inline(always)] unsafe fn lock(f: fn() -> T) -> T { class Unlock { let l: rust_little_lock; @@ -209,6 +212,7 @@ impl Exclusive { // Currently, scheduling operations (i.e., yielding, receiving on a pipe, // accessing the provided condition variable) are prohibited while inside // the exclusive. Supporting that is a work in progress. + #[inline(always)] unsafe fn with(f: fn(x: &mut T) -> U) -> U { let rec = unsafe { get_shared_mutable_state(&self.x) }; do rec.lock.lock {