Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Backtrace::enabled atomic from SeqCst to Relaxed #212

Merged
merged 1 commit into from Dec 23, 2021
Merged

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Dec 23, 2021

This mirrors rust-lang/rust#92139.

The atomic is not synchronizing anything outside of its own value, so we don't need the Acquire/Release guarantee that all memory operations prior to the store are visible after the subsequent load, nor the SeqCst guarantee of all threads seeing all of the sequentially consistent operations in the same order.

Using Relaxed reduces the overhead of Backtrace::capture() in the case that backtraces are not enabled.

@dtolnay dtolnay merged commit 6e17bdb into master Dec 23, 2021
@dtolnay dtolnay deleted the relaxed branch December 23, 2021 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant