pub(crate) fn compile<'data>(
        &mut self,
        module: &Module,
        function_body_inputs: PrimaryMap<DefinedFuncIndex, &'data [u8]>,
    ) -> Result<
        (
            PrimaryMap<DefinedFuncIndex, *mut [VMFunctionBody]>,
            Relocations,
        ),
        SetupError,
    > {
        let (compilation, relocations) =
            cranelift::compile_module(module, function_body_inputs, &*self.isa)
                .map_err(SetupError::Compile)?;

        let allocated_functions =
            allocate_functions(&mut self.code_memory, compilation).map_err(|message| {
                SetupError::Instantiate(InstantiationError::Resource(format!(
                    "failed to allocate memory for functions: {}",
                    message
                )))
            })?;

        Ok((allocated_functions, relocations))
    }
/// Compile the given function bodies.
Compile the given function bodies.
Compile the given function bodies .
pub(crate) fn compile<'data>(
        &mut self,
        module: &Module,
        function_body_inputs: PrimaryMap<DefinedFuncIndex, &'data [u8]>,
    ) -> Result<
        (
            PrimaryMap<DefinedFuncIndex, *mut [VMFunctionBody]>,
            Relocations,
        ),
        SetupError,
    > {
        let (compilation, relocations) =
            cranelift::compile_module(module, function_body_inputs, &*self.isa)
                .map_err(SetupError::Compile)?;
        let allocated_functions =
            allocate_functions(&mut self.code_memory, compilation).map_err(|message| {
                SetupError::Instantiate(InstantiationError::Resource(format!(
                    "failed to allocate memory for functions: {}",
                    message
                )))
            })?;
        Ok((allocated_functions, relocations))
    }
pub ( crate ) fn compile < ' data > ( & mut self , module : & Module , function_body_inputs : PrimaryMap < DefinedFuncIndex , & ' data [ u8 ] > , ) -> Result < ( PrimaryMap < DefinedFuncIndex , * mut [ VMFunctionBody ] > , Relocations , ) , SetupError , > { let ( compilation , relocations ) = cranelift :: compile_module ( module , function_body_inputs , & * self . isa ) . map_err ( SetupError :: Compile ) ? ; let allocated_functions = allocate_functions ( & mut self . code_memory , compilation ) . map_err ( | message | { SetupError :: Instantiate ( InstantiationError :: Resource ( format ! ( " " message ) ) ) } ) ? ; Ok ( ( allocated_functions , relocations ) ) }
Compile the given function bodies.
Compile the given function bodies .
&mut self
module
&Module
function_body_inputs
PrimaryMap<DefinedFuncIndex, &'data [u8]>