fn verify(&mut self) {
        let kernel_start: VirtAddr = VirtAddr(unsafe { &end } as *const _ as usize);

        let mut size = 0;
        let mut next = self.start.next;
        while let Some(mut n) = next {
            unsafe {
                let addr = VirtAddr::new(n.as_ref() as *const _ as usize);
                assert!(addr > kernel_start);
                assert!(addr.to_phys() < PHYSTOP);
                size += n.as_ref().size + 1;
                next = n.as_ref().next;
                if let Some(s) = n.as_ref().next {
                    // assert that addresses in the list must monotonically increase, and that
                    // there are no overlaps between ranges
                    assert!(s.as_ref() as *const _ > n.as_ref() as *const _);
                    assert!(s.as_ref() as *const _ > n.as_mut().end_addr() as *const _);
                }
            }
        }
        assert_eq!(size, self.length);
    }
// Verify that the linked list is well-formed.  Useful for debugging
Verify that the linked list is well-formed.  Useful for debugging
Verify that the linked list is well - formed . Useful for debugging
fn verify(&mut self) {
        let kernel_start: VirtAddr = VirtAddr(unsafe { &end } as *const _ as usize);
        let mut size = 0;
        let mut next = self.start.next;
        while let Some(mut n) = next {
            unsafe {
                let addr = VirtAddr::new(n.as_ref() as *const _ as usize);
                assert!(addr > kernel_start);
                assert!(addr.to_phys() < PHYSTOP);
                size += n.as_ref().size + 1;
                next = n.as_ref().next;
                if let Some(s) = n.as_ref().next {
                    // assert that addresses in the list must monotonically increase, and that
                    // there are no overlaps between ranges
                    assert!(s.as_ref() as *const _ > n.as_ref() as *const _);
                    assert!(s.as_ref() as *const _ > n.as_mut().end_addr() as *const _);
                }
            }
        }
        assert_eq!(size, self.length);
    }
fn verify ( & mut self ) { let kernel_start : VirtAddr = VirtAddr ( unsafe { & end } as * const _ as usize ) ; let mut size = 0 ; let mut next = self . start . next ; while let Some ( mut n ) = next { unsafe { let addr = VirtAddr :: new ( n . as_ref ( ) as * const _ as usize ) ; assert ! ( addr kernel_start ) ; assert ! ( addr to_phys ( ) PHYSTOP ) ; size += n . as_ref ( ) . size + 1 ; next = n . as_ref ( ) . next ; if let Some ( s ) = n . as_ref ( ) . next { // assert that addresses in the list must monotonically increase, and that // there are no overlaps between ranges assert ! ( s as_ref ( ) as const n as_ref ( ) as const ) ; assert ! ( s as_ref ( ) as const n as_mut ( ) end_addr ( ) as const ) ; } } } assert_eq ! ( size self length ) ; }
Verify that the linked list is well-formed.
Verify that the linked list is well - formed .
&mut self
&mut self