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

Add {PhysFrame,Page}::from_start_address_unchecked. #142

Merged
merged 1 commit into from Apr 11, 2020

Conversation

m-ou-se
Copy link
Contributor

@m-ou-se m-ou-se commented Apr 10, 2020

No description provided.

@m-ou-se m-ou-se changed the title Improvements to PhysFrame Add {PhysFrame,Page}::from_start_address_unsafe. Apr 10, 2020
@m-ou-se
Copy link
Contributor Author

m-ou-se commented Apr 10, 2020

const fns apparently don't combine with generics yet, without the const_fn feature. So there's both a const and non-const version of the function.

@m-ou-se
Copy link
Contributor Author

m-ou-se commented Apr 11, 2020

So there's both a const and non-const version of the function.

#144 would remove the need for duplication here.

@m-ou-se
Copy link
Contributor Author

m-ou-se commented Apr 11, 2020

#144 would remove the need for duplication here.

Updated.

@phil-opp
Copy link
Member

phil-opp commented Apr 11, 2020

Thanks! Looks good to me overall.

I think we should probably name these methods from_start_address_unchecked instead of *_unsafe. I know that this would be inconsistent with the naming introduced in #141, but we might want to rename these methods to new_unchecked in the long term too (after a deprecation period).

@m-ou-se
Copy link
Contributor Author

m-ou-se commented Apr 11, 2020

Sure, sounds good. One sec.

@m-ou-se m-ou-se changed the title Add {PhysFrame,Page}::from_start_address_unsafe. Add {PhysFrame,Page}::from_start_address_unchecked. Apr 11, 2020
@m-ou-se
Copy link
Contributor Author

m-ou-se commented Apr 11, 2020

Done.

@phil-opp
Copy link
Member

phil-opp commented Apr 11, 2020

Thanks!

phil-opp added a commit that referenced this pull request Apr 11, 2020
@phil-opp phil-opp merged commit a87fa6f into rust-osdev:master Apr 11, 2020
5 checks passed
phil-opp added a commit that referenced this pull request Apr 11, 2020
@m-ou-se m-ou-se deleted the addr branch Apr 11, 2020
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.

None yet

2 participants