-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
alloc: add some try_* methods Rust-for-Linux needs #86938
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
/// Panic, or worse, according to the global handlers for each case. | ||
pub(crate) fn handle(self) -> ! { |
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.
It might be useful to expose this outside the crate, but I didn't get into that for now.
match Self::try_allocate_in(capacity, init, alloc) { | ||
Ok(r) => r, | ||
Err(e) => e.handle(), | ||
} |
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.
I saw some comment about unwrap_or_else
slowing doing the LLVM portion of compilation so I didn't use it, but if that is no longer the case I am happy to change these.
This comment has been minimized.
This comment has been minimized.
For the file-length tidy check, I'd suggest just adding |
Once this passes CI, we can do a try build and a perf run, to see if deduplicating the non-try methods causes a noticeable performance impact. |
f5f6357
to
e2dfe01
Compare
This comment has been minimized.
This comment has been minimized.
e2dfe01
to
77ea711
Compare
This comment has been minimized.
This comment has been minimized.
77ea711
to
fa2063b
Compare
This comment has been minimized.
This comment has been minimized.
It looks like these will change both inlining and where the panic is called. In the past Vec code has been quite sensitive even to minor perturbations in this area. This is going to be interesting. |
It's stuff like this that makes me wish one could |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit fa2063bc810fab690f0f7d76dbd12ffa8a70e6f6 with merge 27957d81236ab9a355af3d1636314f8272e8ab11... |
Huh I thought i ran the formatter. Will fix and rebase. |
fa2063b
to
bfabebe
Compare
This comment has been minimized.
This comment has been minimized.
In preparation for enabling `no_global_oom_handling` for `alloc`, we need to add some new methods. They are all marked as: #[stable(feature = "kernel", since = "1.0.0")] for easy identification. Signed-off-by: Miguel Ojeda <[email protected]>
@rust-timer build 27957d81236ab9a355af3d1636314f8272e8ab11 |
ping from triage: |
☔ The latest upstream changes (presumably #87408) made this pull request unmergeable. Please resolve the merge conflicts. |
ping again from triage: |
bfabebe
to
a356376
Compare
This comment has been minimized.
This comment has been minimized.
ping from triage: |
ping again from triage: |
a356376
to
824e6c8
Compare
This comment has been minimized.
This comment has been minimized.
I did all the non-specialization trait ones. I hope this doesn't cause performance issues
824e6c8
to
c7a6744
Compare
The job Click to see the possible cause of the failure (guessed by this bot)
|
☔ The latest upstream changes (presumably #90067) made this pull request unmergeable. Please resolve the merge conflicts. |
@Ericson2314 @rustbot label: +S-inactive |
As discussed in #86942 (comment), I'm interested in taking over this PR. How could I continue this work? Maybe I need to fork from @Rust-for-Linux and send a new PR? |
You can fetch the latest commit from rust-lang (PR commits are available as remote refs) and create a branch from it, rebase it against master and open a new PR. |
Based off of Rust-for-Linux/linux@487d757
I also added a second commit to dedup the code using the new
try_
ones in the old infallible ones.I hope this doesn't cause performance issues, but I am not sure.
I didn't yet dedup the specialization traits, simply because I am less familiar with them. If that is desired, I'll do it too.
CC @joshtriplett @TimDiekmann