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

End of year refactoring #75

Merged
merged 15 commits into from
Dec 7, 2022
Merged

End of year refactoring #75

merged 15 commits into from
Dec 7, 2022

Conversation

Urhengulas
Copy link
Member

Some of the refactorings were triggered by clippy, others by just getting into the refactor mood.

Cargo.toml Show resolved Hide resolved
src/main.rs Outdated Show resolved Hide resolved
@@ -147,7 +137,7 @@ fn compute_span_of_ram_sections(ram_entry: MemoryEntry, object: object::File) ->
let mut found_a_section = false;
for section in object.sections() {
if let SectionFlags::Elf { sh_flags } = section.flags() {
if sh_flags & elf::SHF_ALLOC as u64 != 0 {
if (sh_flags & elf::SHF_ALLOC as u64) != 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it bit comparison here?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is. I was confused by that as well in the beginning, therefore I added the brackets.

Copy link
Contributor

@Dajamante Dajamante Dec 7, 2022

Choose a reason for hiding this comment

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

Yes this is nitty-gritty 🗡️ ! Should we add a comment to say what flags this check looks at?

Copy link
Member Author

Choose a reason for hiding this comment

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

We should, but I don't know. SHF_ALLOC says that "Section occupies memory during execution.".

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd prefer not to block this PR on this, but figure out what the check does and add a comment in a separate PR.

src/main.rs Show resolved Hide resolved
@Urhengulas
Copy link
Member Author

bors r=Dajamante

@bors
Copy link
Contributor

bors bot commented Dec 7, 2022

Build succeeded:

@bors bors bot merged commit 81c25ee into main Dec 7, 2022
@bors bors bot deleted the refactor branch December 7, 2022 11:37
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.

2 participants