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

Simplify callsite enabled check #3112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pkoenig10
Copy link

Small refactor to simplify the callsite enabled check in the macros. In particular, it is a bit confusing that the interest.is_never() condition is in the macro while the interest.is_always() condition is in is_enabled.

@pkoenig10 pkoenig10 requested review from hawkw, davidbarsky and a team as code owners October 18, 2024 13:45
Comment on lines 1116 to +1118
#[inline]
pub fn interest(&'static self) -> Interest {
match self.interest.load(Ordering::Relaxed) {
pub fn is_enabled(&'static self) -> bool {
let interest = match self.interest.load(Ordering::Relaxed) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should preserve the intent of #943. Namely, that the per-callsite cached interest check is still inlined.

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.

1 participant