Skip to content

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

Merged
phil-opp merged 1 commit into
rust-osdev:masterfrom
m-ou-se:addr
Apr 11, 2020
Merged

Add {PhysFrame,Page}::from_start_address_unchecked.#142
phil-opp merged 1 commit into
rust-osdev:masterfrom
m-ou-se:addr

Conversation

@m-ou-se

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

Copy link
Copy Markdown
Contributor

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

m-ou-se commented Apr 10, 2020

Copy link
Copy Markdown
Contributor Author

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

m-ou-se commented Apr 11, 2020

Copy link
Copy Markdown
Contributor Author

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

#144 would remove the need for duplication here.

@m-ou-se

m-ou-se commented Apr 11, 2020

Copy link
Copy Markdown
Contributor Author

#144 would remove the need for duplication here.

Updated.

@phil-opp

Copy link
Copy Markdown
Member

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

m-ou-se commented Apr 11, 2020

Copy link
Copy Markdown
Contributor Author

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

m-ou-se commented Apr 11, 2020

Copy link
Copy Markdown
Contributor Author

Done.

@phil-opp

Copy link
Copy Markdown
Member

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
phil-opp added a commit that referenced this pull request Apr 11, 2020
@m-ou-se
m-ou-se deleted the addr branch April 11, 2020 12:04
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