From dae48a07f34dcf714b3b57029f4e03a0b95a269e Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 10 Oct 2014 21:59:10 -0700 Subject: Register new snapshots Also convert a number of `static mut` to just a plain old `static` and remove some unsafe blocks. --- src/libgreen/stack.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libgreen/stack.rs') diff --git a/src/libgreen/stack.rs b/src/libgreen/stack.rs index 23b41f6c6e7..6a5772ff628 100644 --- a/src/libgreen/stack.rs +++ b/src/libgreen/stack.rs @@ -158,8 +158,8 @@ impl StackPool { } fn max_cached_stacks() -> uint { - static mut AMT: atomic::AtomicUint = atomic::INIT_ATOMIC_UINT; - match unsafe { AMT.load(atomic::SeqCst) } { + static AMT: atomic::AtomicUint = atomic::INIT_ATOMIC_UINT; + match AMT.load(atomic::SeqCst) { 0 => {} n => return n - 1, } @@ -169,7 +169,7 @@ fn max_cached_stacks() -> uint { let amt = amt.unwrap_or(10); // 0 is our sentinel value, so ensure that we'll never see 0 after // initialization has run - unsafe { AMT.store(amt + 1, atomic::SeqCst); } + AMT.store(amt + 1, atomic::SeqCst); return amt; } -- cgit 1.4.1-3-g733a5