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

Make more functions const. #116

Merged
merged 2 commits into from
Jan 9, 2020
Merged

Make more functions const. #116

merged 2 commits into from
Jan 9, 2020

Conversation

m-ou-se
Copy link
Contributor

@m-ou-se m-ou-se commented Jan 8, 2020

Other than just adding const a few times, this:

  • Replaces the array_init dependency by the const_in_array_repeat_expressions feature.

  • Implements VirtAddr::new_unchecked using a multiply and divide instead of set_bits in an if. (Bonus: Resulting assembly is much much shorter.)

Copy link
Member

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the pull request! Looks very good to me. I especially like the removal of the array_init dependency, which contributed to long compile times (see #90). I have one comment, otherwise this is ready to merge.

src/addr.rs Show resolved Hide resolved
@phil-opp phil-opp merged commit 074111f into rust-osdev:master Jan 9, 2020
@phil-opp
Copy link
Member

phil-opp commented Jan 9, 2020

Thanks!

@m-ou-se m-ou-se deleted the const-fn branch January 9, 2020 09:16
phil-opp added a commit that referenced this pull request Jan 9, 2020
@phil-opp
Copy link
Member

phil-opp commented Jan 9, 2020

Released together with #115 as version 0.8.3

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