pub fn pop_top<F>(&mut self, f: F) -> MemoryResult
    where
        F: FnOnce(PhysAddr) -> VirtAddr,
    {
        if unlikely(self.top.is_null()) {
            return Err(MemoryError::OOM);
        }

        // Read and set the next top address.
        let ptr = f(self.top).as_const();
        self.top = PhysAddr::new(unsafe { *ptr });
        Ok(())
    }
/// Pops the top and moves the current top pointer. This function is used internally for memory management by paging.
Pops the top and moves the current top pointer. This function is used internally for memory management by paging.
Pops the top and moves the current top pointer . This function is used internally for memory management by paging .
pub fn pop_top<F>(&mut self, f: F) -> MemoryResult
    where
        F: FnOnce(PhysAddr) -> VirtAddr,
    {
        if unlikely(self.top.is_null()) {
            return Err(MemoryError::OOM);
        }
        // Read and set the next top address.
        let ptr = f(self.top).as_const();
        self.top = PhysAddr::new(unsafe { *ptr });
        Ok(())
    }
pub fn pop_top < F > ( & mut self , f : F ) -> MemoryResult where F : FnOnce ( PhysAddr ) -> VirtAddr , { if unlikely ( self . top . is_null ( ) ) { return Err ( MemoryError :: OOM ) ; } // Read and set the next top address. let ptr = f ( self . top ) . as_const ( ) ; self . top = PhysAddr :: new ( unsafe { * ptr } ) ; Ok ( ( ) ) }
Pops the top and moves the current top pointer.
Pops the top and moves the current top pointer .
&mut self
f
F
&mut self
f
F