Closed josephlr closed 2 years ago
We should also update the docs of
new_truncate
because it still mentionsnew
andtry_new
as alternative methods with similar behavior, but these methods don't do any sign extension anymore. So maybe remove that last sentence, or change it to "If you want to check whether an address is canonical ...".
I updated the docs for new
and try_new
to make it clear that they don't sign extend anything (they just check if addresses are canonical). I also made your recommended changes to new_truncate
, added some cross links, and fixed some typos.
The first commit removes our
*const T -> VirtAddr
conversion on 32-bit platforms. Per the comment, it's "only here for backwards compatibility". Should we go even further and remove the conversions on all non-x86_64
platforms?The second commit makes it so
new
andtry_new
fail on non-canonical addresses. Fixes #299The third commit make
new
andtry_new
const. OtherVirtAddr
/PhysAddr
methods are made const in #369 (which will be pulled back into this branch when its merged).