-
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
Refactor compression cache in v0 symbol mangler #87583
Conversation
Compression caches are always present. Remove unnecessary option.
The compression caches currently don't have any dedicated functionality that would benefit from being separated. Incorporating caches directly into the symbol manger also avoids dynamic memory allocation. The symbol mangler, which is often passed by value, is now slightly larger. This aspect will be addressed by a follow-up commit.
to avoid passing the symbol mangler by value.
r? @wesleywiser (rust-highfive has picked a reviewer for you, use r? to override) |
@bors r+ |
📌 Commit 0eabbf8 has been approved by |
Rollup of 10 pull requests Successful merges: - rust-lang#87052 (Optimize fmt::PadAdapter::wrap) - rust-lang#87522 (Fix assert in diy_float) - rust-lang#87553 (Fix typo in rustc_driver::version) - rust-lang#87554 (2229: Discr should be read when PatKind is Range) - rust-lang#87564 (min_type_alias_impl_trait is going to be removed in 1.56) - rust-lang#87574 (Update the examples in `String` and `VecDeque::retain`) - rust-lang#87583 (Refactor compression cache in v0 symbol mangler) - rust-lang#87585 (Add missing links for core::char types) - rust-lang#87594 (fs File get_path procfs usage for netbsd same as linux.) - rust-lang#87602 ([backtraces]: look for the `begin` symbol only after seeing `end`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
|
||
/// The length of the prefix in `out` (e.g. 2 for `_R`). | ||
start_offset: usize, | ||
/// The values are start positions in `out`, in bytes. |
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.
Couple nitpicks (feel free to ignore I guess):
- comment was not doc comment because it applies to all 3 fields
- the names of the fields should've probably been adjusted (or the separate
struct
kept), since now they've lost a bit of context
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.
Ack. Will keep this in mind when making further changes there.
I was looking into the idea of using only shortening back-references, but differences seems to be negligible. For cargo, total symbol size reduction of -0.016% (nm target/debug/cargo | grep -o '_R.*' | wc --bytes
). Could be more useful with const generics, I suppose.
I wonder if I should've have made |
&mut SymbolMangler
instead ofSymbolMangler
to avoid passing now slightly larger symbol mangler by value.