pub fn run(buffer: &[u8], domain: ProtectionDomain) -> Result<(), Error> {
    let compile_result = Box::new(compile(buffer)?);
    let compile_result = Box::into_raw(compile_result);
    // Safety: valid and correct entry point.
    let thread = unsafe {
        Thread::create(
            domain,
            VirtAddr::new(start_from_compile_result as usize),
            compile_result as usize,
        )
        .map_err(Error::MemoryError)?
    };
    add_and_schedule_thread(thread);

    Ok(())
}
/// Runs WebAssembly from a buffer.
Runs WebAssembly from a buffer.
Runs WebAssembly from a buffer .
pub fn run(buffer: &[u8], domain: ProtectionDomain) -> Result<(), Error> {
    let compile_result = Box::new(compile(buffer)?);
    let compile_result = Box::into_raw(compile_result);
    // Safety: valid and correct entry point.
    let thread = unsafe {
        Thread::create(
            domain,
            VirtAddr::new(start_from_compile_result as usize),
            compile_result as usize,
        )
        .map_err(Error::MemoryError)?
    };
    add_and_schedule_thread(thread);
    Ok(())
}
pub fn run ( buffer : & [ u8 ] , domain : ProtectionDomain ) -> Result < ( ) , Error > { let compile_result = Box :: new ( compile ( buffer ) ? ) ; let compile_result = Box :: into_raw ( compile_result ) ; // Safety: valid and correct entry point. let thread = unsafe { Thread :: create ( domain , VirtAddr :: new ( start_from_compile_result as usize ) , compile_result as usize , ) . map_err ( Error :: MemoryError ) ? } ; add_and_schedule_thread ( thread ) ; Ok ( ( ) ) }
Runs WebAssembly from a buffer.
Runs WebAssembly from a buffer .
buffer
&[u8]
domain
ProtectionDomain
buffer
&[u8]
domain
ProtectionDomain