fn committed_pages_in_range(&self, start_idx: usize, end_idx: usize) -> usize {
        assert!(
            start_idx < self.size / PAGE_SIZE || start_idx == 0,
            "start_idx {:#x}, self.size {:#x}",
            start_idx,
            self.size
        );
        assert!(
            end_idx <= self.size / PAGE_SIZE,
            "end_idx {:#x}, self.size {:#x}",
            end_idx,
            self.size
        );
        let mut count = 0;
        for i in start_idx..end_idx {
            if self.frames.contains_key(&i) {
                count += 1;
                continue;
            }
            if self.parent_limit <= i * PAGE_SIZE {
                continue;
            }
            let mut current = self.parent.clone();
            let mut current_idx = i + self.parent_offset / PAGE_SIZE;
            while let Some(vmop) = current {
                let inner = vmop.inner.borrow();
                if let Some(frame) = inner.frames.get(&current_idx) {
                    if frame.tag.is_split() || inner.owner == self.owner {
                        count += 1;
                        break;
                    }
                }
                if inner.owner != self.owner {
                    break;
                }
                current_idx += inner.parent_offset / PAGE_SIZE;
                if current_idx >= inner.parent_limit / PAGE_SIZE {
                    break;
                }
                current = inner.parent.clone();
            }
        }
        count
    }
/// Count committed pages of the VMO.
Count committed pages of the VMO.
Count committed pages of the VMO .
fn committed_pages_in_range(&self, start_idx: usize, end_idx: usize) -> usize {
        assert!(
            start_idx < self.size / PAGE_SIZE || start_idx == 0,
            "start_idx {:#x}, self.size {:#x}",
            start_idx,
            self.size
        );
        assert!(
            end_idx <= self.size / PAGE_SIZE,
            "end_idx {:#x}, self.size {:#x}",
            end_idx,
            self.size
        );
        let mut count = 0;
        for i in start_idx..end_idx {
            if self.frames.contains_key(&i) {
                count += 1;
                continue;
            }
            if self.parent_limit <= i * PAGE_SIZE {
                continue;
            }
            let mut current = self.parent.clone();
            let mut current_idx = i + self.parent_offset / PAGE_SIZE;
            while let Some(vmop) = current {
                let inner = vmop.inner.borrow();
                if let Some(frame) = inner.frames.get(&current_idx) {
                    if frame.tag.is_split() || inner.owner == self.owner {
                        count += 1;
                        break;
                    }
                }
                if inner.owner != self.owner {
                    break;
                }
                current_idx += inner.parent_offset / PAGE_SIZE;
                if current_idx >= inner.parent_limit / PAGE_SIZE {
                    break;
                }
                current = inner.parent.clone();
            }
        }
        count
    }
fn committed_pages_in_range ( & self , start_idx : usize , end_idx : usize ) -> usize { assert ! ( start_idx self size PAGE_SIZE start_idx 0 " " start_idx self size ) ; assert ! ( end_idx self size PAGE_SIZE " " end_idx self size ) ; let mut count = 0 ; for i in start_idx .. end_idx { if self . frames . contains_key ( & i ) { count += 1 ; continue ; } if self . parent_limit <= i * PAGE_SIZE { continue ; } let mut current = self . parent . clone ( ) ; let mut current_idx = i + self . parent_offset / PAGE_SIZE ; while let Some ( vmop ) = current { let inner = vmop . inner . borrow ( ) ; if let Some ( frame ) = inner . frames . get ( & current_idx ) { if frame . tag . is_split ( ) || inner . owner == self . owner { count += 1 ; break ; } } if inner . owner != self . owner { break ; } current_idx += inner . parent_offset / PAGE_SIZE ; if current_idx >= inner . parent_limit / PAGE_SIZE { break ; } current = inner . parent . clone ( ) ; } } count }
Count committed pages of the VMO.
Count committed pages of the VMO .
&self
start_idx
usize
end_idx
usize
&self
start_idx
usize
end_idx
usize