Skip to content
Myr

Merge pull request #212 from dtolnay/relaxed

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Change Backtrace::enabled atomic from SeqCst to Relaxed

authored by David Tolnay · committed by GitHub · parents a3f7160, 6b3630c · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:src/backtrace.rs+2 added-2 removed
180 unmodified lines
181182 impl Backtrace {183 fn enabled() -> bool {184 static ENABLED: AtomicUsize = AtomicUsize::new(0);185 match ENABLED.load(Ordering::SeqCst) {185 match ENABLED.load(Ordering::Relaxed) {186 0 => {}187 1 => return false,188 _ => return true,189 }
3 unmodified lines
193 Some(s) => s != "0",194 None => false,195 },196 };197 ENABLED.store(enabled as usize + 1, Ordering::SeqCst);197 ENABLED.store(enabled as usize + 1, Ordering::Relaxed);198 enabled199 }200201 #[inline(never)] // want to make sure there's a frame here to remove
200 unmodified lines