Skip to content

Commit

Permalink
Update VirtAddr::try_new documentation
Browse files Browse the repository at this point in the history
Co-authored-by: Philipp Oppermann <[email protected]>
  • Loading branch information
josephlr and phil-opp authored Mar 31, 2022
1 parent 49b41c8 commit da30e4c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ impl VirtAddr {

/// Tries to create a new canonical virtual address.
///
/// This function tries to performs sign extension of bit 47 to make the
/// address canonical. It succeeds if bits 48 to 64 are a correct sign
/// extension (i.e. copies of bit 47). Else, an error is returned.
/// This function checks wether the given address is canonical
/// and returns an error otherwise. An address is canoncial
/// if bits 48 to 64 are a correct sign
/// extension (i.e. copies of bit 47).
#[inline]
pub const fn try_new(addr: u64) -> Result<VirtAddr, VirtAddrNotValid> {
let v = Self::new_truncate(addr);
Expand Down

0 comments on commit da30e4c

Please sign in to comment.