-
Notifications
You must be signed in to change notification settings - Fork 132
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
Various improvements to VirtAddr and PhysAddr. #141
Conversation
061a70a
to
21b9500
Compare
Thanks a lot! I fully agree with your reasoning. However, I don't think that it's a good idea to use the same |
Sure. Any suggestions? |
I don't have any good ideas, but
That's a good idea! |
The old name suggests it's an unsafe function that wraps the given address without any checks or modifications, like NonZeroU64::new_unchecked. The old name is still available, but #[deprecated].
Like NonZeroU64::new_unchecked, they wrap the given value without any checks or modifications.
Updated. Now it's no longer a breaking change. |
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.
Thank you!
Given that this still involves some churn for users, I would like to release it as a new semver-incompatible version, preferable together with some other breaking changes that I want to make. This might take a few days, I hope this is fine with you. |
VirtAddr::new_unchecked
didn't behave like thenew_unchecked
functions incore
which just wrap the value without checks or modifications, but instead behaved likePhysAddr::new_truncate
. This change renames it tonew_truncate
, and adds unsafenew_unchecked
new_unsafe
functions.Unfortunately, that does mean it's a breaking change. However,I think following this convention for "unchecked" is important to not cause confusion:new_unchecked
would do that.)new_unchecked
, and was surprised by the compiler warning that theunsafe
block was unnecessary.Also fixes and adds some other small things.