fn determine_offset(
        &self,
        inner: &VmarInner,
        offset: Option<usize>,
        len: usize,
        align: usize,
    ) -> ZxResult<VirtAddr> {
        if !check_aligned(len, align) {
            Err(ZxError::INVALID_ARGS)
        } else if let Some(offset) = offset {
            if check_aligned(offset, align) && self.test_map(inner, offset, len, align) {
                Ok(offset)
            } else {
                Err(ZxError::INVALID_ARGS)
            }
        } else if len > self.size {
            Err(ZxError::INVALID_ARGS)
        } else {
            match self.find_free_area(inner, 0, len, align) {
                Some(offset) => Ok(offset),
                None => Err(ZxError::NO_MEMORY),
            }
        }
    }
/// Determine final address with given input `offset` and `len`.
Determine final address with given input `offset` and `len`.
Determine final address with given input ` offset ` and ` len ` .
fn determine_offset(
        &self,
        inner: &VmarInner,
        offset: Option<usize>,
        len: usize,
        align: usize,
    ) -> ZxResult<VirtAddr> {
        if !check_aligned(len, align) {
            Err(ZxError::INVALID_ARGS)
        } else if let Some(offset) = offset {
            if check_aligned(offset, align) && self.test_map(inner, offset, len, align) {
                Ok(offset)
            } else {
                Err(ZxError::INVALID_ARGS)
            }
        } else if len > self.size {
            Err(ZxError::INVALID_ARGS)
        } else {
            match self.find_free_area(inner, 0, len, align) {
                Some(offset) => Ok(offset),
                None => Err(ZxError::NO_MEMORY),
            }
        }
    }
fn determine_offset ( & self , inner : & VmarInner , offset : Option < usize > , len : usize , align : usize , ) -> ZxResult < VirtAddr > { if ! check_aligned ( len , align ) { Err ( ZxError :: INVALID_ARGS ) } else if let Some ( offset ) = offset { if check_aligned ( offset , align ) && self . test_map ( inner , offset , len , align ) { Ok ( offset ) } else { Err ( ZxError :: INVALID_ARGS ) } } else if len > self . size { Err ( ZxError :: INVALID_ARGS ) } else { match self . find_free_area ( inner , 0 , len , align ) { Some ( offset ) => Ok ( offset ) , None => Err ( ZxError :: NO_MEMORY ) , } } }
Determine final address with given input `offset` and `len`.
Determine final address with given input ` offset ` and ` len ` .
&self
inner
&VmarInner
offset
Option<usize>
len
usize
align
usize
&self
inner
&VmarInner
offset
Option<usize>
len
usize
align
usize