-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
fix __rust_alloc_error_handler comment #77738
Conversation
85f1075
to
1e6702c
Compare
// This is the magic symbol to call the global alloc error handler. rustc generates | ||
// it to call `__rg_oom` if there is a `#[global_allocator]`, or uses the | ||
// default implementations below (`__rdl_oom`) otherwise. | ||
#[rustc_allocator_nounwind] |
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.
This attribute leaves me rather uneasy, since the default implementation does unwind... see https://github.com/rust-lang/rust/pull/76448/files#r502291279.
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 have no idea if it is safe or what else could happen. Presumably it will lead to unwinding edges on OOM calls which could have perf impact.
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.
EDIT (accidently removed): If it is safe, please remove... It was blindly copied.
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 think it's fine to leave the attribute for now.
8e3dfdb
to
fe07e5d
Compare
fe07e5d
to
1911d21
Compare
@bors r+ |
📌 Commit b6bedc8 has been approved by |
@bors rollup |
…t, r=Amanieu fix __rust_alloc_error_handler comment `__rust_alloc_error_handler` was added in the same `extern` block as the allocator functions, but the comment there was not actually correct for `__rust_alloc_error_handler`. So move it down to the rest of the default allocator handling with a fixed comment. At least the comment reflects my understanding of what happens, please check carefully. :) r? @Amanieu Cc @haraldh
Rollup of 10 pull requests Successful merges: - rust-lang#77195 (Link to documentation-specific guidelines.) - rust-lang#77629 (Cleanup of `eat_while()` in lexer) - rust-lang#77709 (Link Vec leak doc to Box) - rust-lang#77738 (fix __rust_alloc_error_handler comment) - rust-lang#77748 (Dead code cleanup in windows-gnu std) - rust-lang#77754 (Add TraitDef::find_map_relevant_impl) - rust-lang#77766 (Clarify the debug-related values should take boolean) - rust-lang#77777 (doc: disambiguate stat in MetadataExt::as_raw_stat) - rust-lang#77782 (Fix typo in error code description) - rust-lang#77787 (Update `changelog-seen` in config.toml.example) Failed merges: r? `@ghost`
__rust_alloc_error_handler
was added in the sameextern
block as the allocator functions, but the comment there was not actually correct for__rust_alloc_error_handler
. So move it down to the rest of the default allocator handling with a fixed comment. At least the comment reflects my understanding of what happens, please check carefully. :)r? @Amanieu Cc @haraldh