Skip to content

Commit

Permalink
Remove #[inline(never)]
Browse files Browse the repository at this point in the history
  • Loading branch information
faern committed May 25, 2019
1 parent f9f951b commit c162cfc
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 25 deletions.
1 change: 0 additions & 1 deletion core/src/parking_lot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ fn get_hashtable() -> *mut HashTable {

// Get a pointer to the latest hash table, creating one if it doesn't exist yet.
#[cold]
#[inline(never)]
fn create_hashtable() -> *mut HashTable {
let new_table = Box::into_raw(HashTable::new(LOAD_FACTOR, ptr::null()));

Expand Down
1 change: 0 additions & 1 deletion core/src/thread_parker/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ impl Backend {
}

#[cold]
#[inline(never)]
fn create() -> &'static Backend {
// Try to create a new Backend
let backend;
Expand Down
2 changes: 0 additions & 2 deletions core/src/word_lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ impl WordLock {
}

#[cold]
#[inline(never)]
fn lock_slow(&self) {
let mut spinwait = SpinWait::new();
let mut state = self.state.load(Ordering::Relaxed);
Expand Down Expand Up @@ -171,7 +170,6 @@ impl WordLock {
}

#[cold]
#[inline(never)]
fn unlock_slow(&self) {
let mut state = self.state.load(Ordering::Relaxed);
loop {
Expand Down
2 changes: 0 additions & 2 deletions src/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ impl Condvar {
}

#[cold]
#[inline(never)]
fn notify_one_slow(&self, mutex: *mut RawMutex) -> bool {
unsafe {
// Unpark one thread and requeue the rest onto the mutex
Expand Down Expand Up @@ -191,7 +190,6 @@ impl Condvar {
}

#[cold]
#[inline(never)]
fn notify_all_slow(&self, mutex: *mut RawMutex) -> usize {
unsafe {
// Unpark one thread and requeue the rest onto the mutex
Expand Down
1 change: 0 additions & 1 deletion src/once.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ impl Once {
// currently no way to take an `FnOnce` and call it via virtual dispatch
// without some allocation overhead.
#[cold]
#[inline(never)]
fn call_once_slow(&self, ignore_poison: bool, f: &mut dyn FnMut(OnceState)) {
let mut spinwait = SpinWait::new();
let mut state = self.0.load(Ordering::Relaxed);
Expand Down
3 changes: 0 additions & 3 deletions src/raw_mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ impl RawMutex {
}

#[cold]
#[inline(never)]
fn lock_slow(&self, timeout: Option<Instant>) -> bool {
let mut spinwait = SpinWait::new();
let mut state = self.state.load(Ordering::Relaxed);
Expand Down Expand Up @@ -253,7 +252,6 @@ impl RawMutex {
}

#[cold]
#[inline(never)]
fn unlock_slow(&self, force_fair: bool) {
// Unpark one thread and leave the parked bit set if there might
// still be parked threads on this address.
Expand Down Expand Up @@ -285,7 +283,6 @@ impl RawMutex {
}

#[cold]
#[inline(never)]
fn bump_slow(&self) {
unsafe { deadlock::release_resource(self as *const _ as usize) };
self.unlock_slow(true);
Expand Down
15 changes: 0 additions & 15 deletions src/raw_rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,6 @@ impl RawRwLock {
}

#[cold]
#[inline(never)]
fn try_lock_shared_slow(&self, recursive: bool) -> bool {
let mut state = self.state.load(Ordering::Relaxed);
loop {
Expand Down Expand Up @@ -541,7 +540,6 @@ impl RawRwLock {
}

#[cold]
#[inline(never)]
fn try_lock_upgradable_slow(&self) -> bool {
let mut state = self.state.load(Ordering::Relaxed);
loop {
Expand All @@ -565,7 +563,6 @@ impl RawRwLock {
}

#[cold]
#[inline(never)]
fn lock_exclusive_slow(&self, timeout: Option<Instant>) -> bool {
// Step 1: grab exclusive ownership of WRITER_BIT
let timed_out = !self.lock_common(
Expand Down Expand Up @@ -600,7 +597,6 @@ impl RawRwLock {
}

#[cold]
#[inline(never)]
fn unlock_exclusive_slow(&self, force_fair: bool) {
// There are threads to unpark. Try to unpark as many as we can.
let callback = |mut new_state, result: UnparkResult| {
Expand All @@ -626,7 +622,6 @@ impl RawRwLock {
}

#[cold]
#[inline(never)]
fn lock_shared_slow(&self, recursive: bool, timeout: Option<Instant>) -> bool {
self.lock_common(
timeout,
Expand Down Expand Up @@ -676,7 +671,6 @@ impl RawRwLock {
}

#[cold]
#[inline(never)]
fn unlock_shared_slow(&self) {
// At this point WRITER_PARKED_BIT is set and READER_MASK is empty. We
// just need to wake up a potentially sleeping pending writer.
Expand All @@ -695,7 +689,6 @@ impl RawRwLock {
}

#[cold]
#[inline(never)]
fn lock_upgradable_slow(&self, timeout: Option<Instant>) -> bool {
self.lock_common(
timeout,
Expand Down Expand Up @@ -734,7 +727,6 @@ impl RawRwLock {
}

#[cold]
#[inline(never)]
fn unlock_upgradable_slow(&self, force_fair: bool) {
// Just release the lock if there are no parked threads.
let mut state = self.state.load(Ordering::Relaxed);
Expand Down Expand Up @@ -801,7 +793,6 @@ impl RawRwLock {
}

#[cold]
#[inline(never)]
fn try_upgrade_slow(&self) -> bool {
let mut state = self.state.load(Ordering::Relaxed);
loop {
Expand All @@ -821,13 +812,11 @@ impl RawRwLock {
}

#[cold]
#[inline(never)]
fn upgrade_slow(&self, timeout: Option<Instant>) -> bool {
self.wait_for_readers(timeout, ONE_READER | UPGRADABLE_BIT)
}

#[cold]
#[inline(never)]
fn downgrade_slow(&self) {
// We only reach this point if PARKED_BIT is set.
let callback = |_, result: UnparkResult| {
Expand All @@ -841,7 +830,6 @@ impl RawRwLock {
}

#[cold]
#[inline(never)]
fn downgrade_to_upgradable_slow(&self) {
// We only reach this point if PARKED_BIT is set.
let callback = |_, result: UnparkResult| {
Expand All @@ -855,22 +843,19 @@ impl RawRwLock {
}

#[cold]
#[inline(never)]
fn bump_shared_slow(&self) {
self.unlock_shared();
self.lock_shared();
}

#[cold]
#[inline(never)]
fn bump_exclusive_slow(&self) {
self.deadlock_release();
self.unlock_exclusive_slow(true);
self.lock_exclusive();
}

#[cold]
#[inline(never)]
fn bump_upgradable_slow(&self) {
self.deadlock_release();
self.unlock_upgradable_slow(true);
Expand Down

0 comments on commit c162cfc

Please sign in to comment.