// See the comments of `PageValidation`.
See the comments of `PageValidation`.
See the comments of ` PageValidation ` .
unsafe fn compute_validation(&self) -> PageValidation {
        // Search for the first non-zero 8-byte word.
        let mut ptr = self.ptr.0 as *const u64;
        let end = self.ptr.0.add(PAGE_SIZE) as *const u64;
        while ptr != end && *ptr == 0 {
            ptr = ptr.add(1);
        }
        if ptr == end {
            // The page contains only zeros.
            return PageValidation::default();
        }
        // We found the non-zero 8-byte word. Now find the non-zero two-byte
        // word within it. The `while` loop below is guaranteed to stop after
        // at most four steps.
        let mut ptr = ptr as *const u16;
        while *ptr == 0 {
            ptr = ptr.add(1);
        }
        PageValidation {
            non_zero_word_index: ptr.offset_from(self.ptr.0 as *const u16) as u16,
            non_zero_word_value: *ptr,
        }
    }
unsafe fn compute_validation ( & self ) -> PageValidation { // Search for the first non-zero 8-byte word. let mut ptr = self . ptr . 0 as * const u64 ; let end = self . ptr . 0 . add ( PAGE_SIZE ) as * const u64 ; while ptr != end && * ptr == 0 { ptr = ptr . add ( 1 ) ; } if ptr == end { // The page contains only zeros. return PageValidation :: default ( ) ; } // We found the non-zero 8-byte word. Now find the non-zero two-byte // word within it. The `while` loop below is guaranteed to stop after // at most four steps. let mut ptr = ptr as * const u16 ; while * ptr == 0 { ptr = ptr . add ( 1 ) ; } PageValidation { non_zero_word_index : ptr . offset_from ( self . ptr . 0 as * const u16 ) as u16 , non_zero_word_value : * ptr , } }
See the comments of `PageValidation`.
See the comments of ` PageValidation ` .
&self