-
Notifications
You must be signed in to change notification settings - Fork 14k
Add #[inline] to RawWaker::new #74791
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
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
KodrAus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this method is const is there a reason to inline it?
|
The data pointer is usually different for each task and determined at runtime, This is something I noticed while examining the perf report. |
|
☔ The latest upstream changes (presumably #73265) made this pull request unmergeable. Please resolve the merge conflicts. |
e76636b to
0a51a9f
Compare
|
Seems reasonable. @bors r+ rollup=always |
|
📌 Commit 0a51a9f has been approved by |
|
I think this may affect perf and shouldn't be |
|
Thanks for catching that. I forgot about it. Can I simply change it after approving it like this? @bors rollup=never |
Yep, it works. |
|
☀️ Test successful - checks-actions, checks-azure |
RawWaker::newis used when creating a new waker or cloning an existing one,for example as in code below. The
RawWakerVTable::newcan be const evaluated,but
RawWaker::newitself cannot since waker pointer is not known at compiletime. Add
#[inline]to avoid overhead of a function call.