Register new snapshots
Also convert a number of `static mut` to just a plain old `static` and remove some unsafe blocks.
This commit is contained in:
@@ -41,8 +41,8 @@ pub fn limit_thread_creation_due_to_osx_and_valgrind() -> bool {
|
||||
}
|
||||
|
||||
pub fn min_stack() -> uint {
|
||||
static mut MIN: atomic::AtomicUint = atomic::INIT_ATOMIC_UINT;
|
||||
match unsafe { MIN.load(atomic::SeqCst) } {
|
||||
static MIN: atomic::AtomicUint = atomic::INIT_ATOMIC_UINT;
|
||||
match MIN.load(atomic::SeqCst) {
|
||||
0 => {}
|
||||
n => return n - 1,
|
||||
}
|
||||
@@ -50,7 +50,7 @@ pub fn min_stack() -> uint {
|
||||
let amt = amt.unwrap_or(2 * 1024 * 1024);
|
||||
// 0 is our sentinel value, so ensure that we'll never see 0 after
|
||||
// initialization has run
|
||||
unsafe { MIN.store(amt + 1, atomic::SeqCst); }
|
||||
MIN.store(amt + 1, atomic::SeqCst);
|
||||
return amt;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user