Showing 3 of 3 files from the diff.
@@ -35,6 +35,8 @@
Loading
35 | 35 | fn sync(&self) -> PRes<()>; |
|
36 | 36 | ||
37 | 37 | fn trim_or_free_page(&self, page: u64, update_list: &mut dyn UpdateList) -> PRes<()>; |
|
38 | + | ||
39 | + | fn trim_end_pages(&self, update_list: &mut dyn UpdateList) -> PRes<()>; |
|
38 | 40 | } |
|
39 | 41 | ||
40 | 42 | trait SizeTool { |
@@ -564,10 +566,15 @@
Loading
564 | 566 | self.file.write_all_at(&[0u8; 16], page + 10)?; |
|
565 | 567 | } |
|
566 | 568 | } else { |
|
567 | - | while self.check_and_trim(update_list)? {} |
|
569 | + | self.trim_end_pages(update_list)?; |
|
568 | 570 | } |
|
569 | 571 | Ok(()) |
|
570 | 572 | } |
|
573 | + | ||
574 | + | fn trim_end_pages(&self, update_list: &mut dyn UpdateList) -> PRes<()> { |
|
575 | + | while self.check_and_trim(update_list)? {} |
|
576 | + | Ok(()) |
|
577 | + | } |
|
571 | 578 | } |
|
572 | 579 | ||
573 | 580 | #[cfg(not(unix))] |
@@ -643,6 +650,11 @@
Loading
643 | 650 | fn trim_or_free_page(&self, page: u64, update_list: &mut dyn UpdateList) -> PRes<()> { |
|
644 | 651 | trim_or_free_page(&mut self.file.lock()?.file, page, update_list) |
|
645 | 652 | } |
|
653 | + | ||
654 | + | fn trim_end_pages(&self, update_list: &mut dyn UpdateList) -> PRes<()> { |
|
655 | + | while check_and_trim(&mut self.file.lock()?.file, update_list)? {} |
|
656 | + | Ok(()) |
|
657 | + | } |
|
646 | 658 | } |
|
647 | 659 | ||
648 | 660 | pub struct MemRef { |
@@ -688,6 +700,10 @@
Loading
688 | 700 | fn trim_or_free_page(&self, page: u64, update_list: &mut dyn UpdateList) -> PRes<()> { |
|
689 | 701 | trim_or_free_page(&mut *self.data.lock()?, page, update_list) |
|
690 | 702 | } |
|
703 | + | fn trim_end_pages(&self, update_list: &mut dyn UpdateList) -> PRes<()> { |
|
704 | + | while check_and_trim(&mut *self.data.lock()?, update_list)? {} |
|
705 | + | Ok(()) |
|
706 | + | } |
|
691 | 707 | } |
|
692 | 708 | #[cfg(test)] |
|
693 | 709 | mod tests { |
@@ -239,6 +239,11 @@
Loading
239 | 239 | } |
|
240 | 240 | Ok(()) |
|
241 | 241 | } |
|
242 | + | pub fn trim_free_at_end(&self) -> PRes<()> { |
|
243 | + | let mut fl = self.free_list.lock()?; |
|
244 | + | self.disc.trim_end_pages(&mut fl.list)?; |
|
245 | + | Ok(()) |
|
246 | + | } |
|
242 | 247 | ||
243 | 248 | pub fn free(&self, page: u64) -> PRes<()> { |
|
244 | 249 | self.cache.lock()?.remove(page); |
712128225
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file.
The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files.
The size and color of each slice is representing the number of statements and the coverage, respectively.