Mark internal functions as not needing `unsafe`

Even though they're not used by any `safe` code
pull/3/head
Bradlee Speice 2018-11-10 22:01:41 -05:00
parent 4e16b79486
commit 80f1d5c1f8
1 changed files with 3 additions and 3 deletions

View File

@ -73,7 +73,7 @@ pub fn exit_protected() {
static INTERNAL_ALLOCATION: RwLock<usize> = RwLock::new(usize::max_value()); static INTERNAL_ALLOCATION: RwLock<usize> = RwLock::new(usize::max_value());
unsafe fn claim_internal_alloc() { fn claim_internal_alloc() {
loop { loop {
match INTERNAL_ALLOCATION.write() { match INTERNAL_ALLOCATION.write() {
ref mut lock if **lock == usize::max_value() => { ref mut lock if **lock == usize::max_value() => {
@ -85,14 +85,14 @@ unsafe fn claim_internal_alloc() {
} }
} }
unsafe fn release_internal_alloc() { fn release_internal_alloc() {
match INTERNAL_ALLOCATION.write() { match INTERNAL_ALLOCATION.write() {
ref mut lock if **lock == thread_id::get() => **lock = usize::max_value(), ref mut lock if **lock == thread_id::get() => **lock = usize::max_value(),
_ => panic!("Internal allocation tracking error"), _ => panic!("Internal allocation tracking error"),
} }
} }
unsafe fn alloc_immediate() -> bool { fn alloc_immediate() -> bool {
thread::panicking() || *INTERNAL_ALLOCATION.read() == thread_id::get() thread::panicking() || *INTERNAL_ALLOCATION.read() == thread_id::get()
} }