pub trait CleanUp {
    unsafe fn clean_up<D>(&mut self, frame_deallocator: &mut D)
    where
        D: FrameDeallocator<Size4KiB>
;
unsafe fn clean_up_addr_range<D>(
        &mut self,
        range: PageRangeInclusive,
        frame_deallocator: &mut D
    )
    where
        D: FrameDeallocator<Size4KiB>
; }
Expand description

Provides methods for cleaning up unused entries.

Required methods

Remove all empty P1-P3 tables

Safety

The caller has to guarantee that it’s safe to free page table frames: All page table frames must only be used once and only in this page table (e.g. no reference counted page tables or reusing the same page tables for different virtual addresses ranges in the same page table).

Remove all empty P1-P3 tables in a certain range

// clean up all page tables in the lower half of the address space
let lower_half = Page::range_inclusive(
    Page::containing_address(VirtAddr::new(0)),
    Page::containing_address(VirtAddr::new(0x0000_7fff_ffff_ffff)),
);
page_table.clean_up_addr_range(lower_half, frame_deallocator);
Safety

The caller has to guarantee that it’s safe to free page table frames: All page table frames must only be used once and only in this page table (e.g. no reference counted page tables or reusing the same page tables for different virtual addresses ranges in the same page table).

Implementors