Skip to content

Commit

Permalink
replace #[inline(always)] with #[inline]. r=burningtree.
Browse files Browse the repository at this point in the history
  • Loading branch information
graydon committed Jun 18, 2013
1 parent 303d7bf commit d904c72
Show file tree
Hide file tree
Showing 79 changed files with 1,319 additions and 1,319 deletions.
22 changes: 11 additions & 11 deletions src/libextra/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub struct Condvar<'self> {

impl<'self> Condvar<'self> {
/// Atomically exit the associated ARC and block until a signal is sent.
#[inline(always)]
#[inline]
pub fn wait(&self) { self.wait_on(0) }

/**
Expand All @@ -67,7 +67,7 @@ impl<'self> Condvar<'self> {
*
* wait() is equivalent to wait_on(0).
*/
#[inline(always)]
#[inline]
pub fn wait_on(&self, condvar_id: uint) {
assert!(!*self.failed);
self.cond.wait_on(condvar_id);
Expand All @@ -76,28 +76,28 @@ impl<'self> Condvar<'self> {
}

/// Wake up a blocked task. Returns false if there was no blocked task.
#[inline(always)]
#[inline]
pub fn signal(&self) -> bool { self.signal_on(0) }

/**
* Wake up a blocked task on a specified condvar (as
* sync::cond.signal_on). Returns false if there was no blocked task.
*/
#[inline(always)]
#[inline]
pub fn signal_on(&self, condvar_id: uint) -> bool {
assert!(!*self.failed);
self.cond.signal_on(condvar_id)
}

/// Wake up all blocked tasks. Returns the number of tasks woken.
#[inline(always)]
#[inline]
pub fn broadcast(&self) -> uint { self.broadcast_on(0) }

/**
* Wake up all blocked tasks on a specified condvar (as
* sync::cond.broadcast_on). Returns the number of tasks woken.
*/
#[inline(always)]
#[inline]
pub fn broadcast_on(&self, condvar_id: uint) -> uint {
assert!(!*self.failed);
self.cond.broadcast_on(condvar_id)
Expand Down Expand Up @@ -198,7 +198,7 @@ impl<T:Owned> MutexARC<T> {
* any tasks that subsequently try to access it (including those already
* blocked on the mutex) will also fail immediately.
*/
#[inline(always)]
#[inline]
pub unsafe fn access<U>(&self, blk: &fn(x: &mut T) -> U) -> U {
unsafe {
let state = self.x.get();
Expand All @@ -213,7 +213,7 @@ impl<T:Owned> MutexARC<T> {
}

/// As access(), but with a condvar, as sync::mutex.lock_cond().
#[inline(always)]
#[inline]
pub unsafe fn access_cond<'x, 'c, U>(&self,
blk: &fn(x: &'x mut T,
c: &'c Condvar) -> U)
Expand All @@ -231,7 +231,7 @@ impl<T:Owned> MutexARC<T> {
}

// Common code for {mutex.access,rwlock.write}{,_cond}.
#[inline(always)]
#[inline]
#[doc(hidden)]
fn check_poison(is_mutex: bool, failed: bool) {
if failed {
Expand Down Expand Up @@ -322,7 +322,7 @@ impl<T:Const + Owned> RWARC<T> {
* that other tasks won't block forever. As MutexARC.access, it will also
* poison the ARC, so subsequent readers and writers will both also fail.
*/
#[inline(always)]
#[inline]
pub fn write<U>(&self, blk: &fn(x: &mut T) -> U) -> U {
unsafe {
let state = self.x.get();
Expand All @@ -335,7 +335,7 @@ impl<T:Const + Owned> RWARC<T> {
}

/// As write(), but with a condvar, as sync::rwlock.write_cond().
#[inline(always)]
#[inline]
pub fn write_cond<'x, 'c, U>(&self,
blk: &fn(x: &'x mut T, c: &'c Condvar) -> U)
-> U {
Expand Down
16 changes: 8 additions & 8 deletions src/libextra/arena.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ pub fn Arena() -> Arena {
arena_with_size(32u)
}

#[inline(always)]
#[inline]
fn round_up_to(base: uint, align: uint) -> uint {
(base + (align - 1)) & !(align - 1)
}
Expand Down Expand Up @@ -156,12 +156,12 @@ unsafe fn destroy_chunk(chunk: &Chunk) {
// initialized in the arena in the low bit of the tydesc pointer. This
// is necessary in order to properly do cleanup if a failure occurs
// during an initializer.
#[inline(always)]
#[inline]
unsafe fn bitpack_tydesc_ptr(p: *TypeDesc, is_done: bool) -> uint {
let p_bits: uint = transmute(p);
p_bits | (is_done as uint)
}
#[inline(always)]
#[inline]
unsafe fn un_bitpack_tydesc_ptr(p: uint) -> (*TypeDesc, bool) {
(transmute(p & !1), p & 1 == 1)
}
Expand All @@ -179,7 +179,7 @@ impl Arena {
return self.alloc_pod_inner(n_bytes, align);
}

#[inline(always)]
#[inline]
fn alloc_pod_inner(&mut self, n_bytes: uint, align: uint) -> *u8 {
unsafe {
// XXX: Borrow check
Expand All @@ -199,7 +199,7 @@ impl Arena {
}
}

#[inline(always)]
#[inline]
fn alloc_pod<'a, T>(&'a mut self, op: &fn() -> T) -> &'a T {
unsafe {
let tydesc = sys::get_type_desc::<T>();
Expand All @@ -223,7 +223,7 @@ impl Arena {
return self.alloc_nonpod_inner(n_bytes, align);
}

#[inline(always)]
#[inline]
fn alloc_nonpod_inner(&mut self, n_bytes: uint, align: uint)
-> (*u8, *u8) {
unsafe {
Expand All @@ -246,7 +246,7 @@ impl Arena {
}
}

#[inline(always)]
#[inline]
fn alloc_nonpod<'a, T>(&'a mut self, op: &fn() -> T) -> &'a T {
unsafe {
let tydesc = sys::get_type_desc::<T>();
Expand All @@ -268,7 +268,7 @@ impl Arena {
}

// The external interface
#[inline(always)]
#[inline]
pub fn alloc<'a, T>(&'a mut self, op: &fn() -> T) -> &'a T {
unsafe {
// XXX: Borrow check
Expand Down
Loading

0 comments on commit d904c72

Please sign in to comment.