/// The caller must ensure that the pages are not already freed. Keep holding
/// `OwnedPages` to free the pages in RAII basis.
The caller must ensure that the pages are not already freed. Keep holding
`OwnedPages` to free the pages in RAII basis.
The caller must ensure that the pages are not already freed . Keep holding ` OwnedPages ` to free the pages in RAII basis .
pub fn free_pages(paddr: PAddr, num_pages: usize) {
    if cfg!(debug_assertions) {
        // Poison the memory.
        unsafe {
            paddr
                .as_mut_ptr::<u8>()
                .write_bytes(0xa5, num_pages * PAGE_SIZE);
        }
    }
    let order = num_pages_to_order(num_pages);
    let mut zones = ZONES.lock();
    for zone in zones.iter_mut() {
        if zone.includes(paddr.value()) {
            zone.free_pages(paddr.value(), order);
            return;
        }
    }
}
pub fn free_pages ( paddr : PAddr , num_pages : usize ) { if cfg ! ( debug_assertions ) { // Poison the memory. unsafe { paddr . as_mut_ptr :: < u8 > ( ) . write_bytes ( 0xa5 , num_pages * PAGE_SIZE ) ; } } let order = num_pages_to_order ( num_pages ) ; let mut zones = ZONES . lock ( ) ; for zone in zones . iter_mut ( ) { if zone . includes ( paddr . value ( ) ) { zone . free_pages ( paddr . value ( ) , order ) ; return ; } } }
The caller must ensure that the pages are not already freed.
The caller must ensure that the pages are not already freed .
paddr
PAddr
num_pages
usize