mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-22 05:01:33 +00:00
fix formatting
This commit is contained in:
@ -51,7 +51,8 @@ impl Instance {
|
|||||||
|
|
||||||
// Initialize the vm::Ctx in-place after the backing
|
// Initialize the vm::Ctx in-place after the backing
|
||||||
// has been boxed.
|
// has been boxed.
|
||||||
*inner.vmctx = unsafe { vm::Ctx::new(&mut inner.backing, &mut inner.import_backing, &module) };
|
*inner.vmctx =
|
||||||
|
unsafe { vm::Ctx::new(&mut inner.backing, &mut inner.import_backing, &module) };
|
||||||
|
|
||||||
let mut instance = Instance {
|
let mut instance = Instance {
|
||||||
module,
|
module,
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
pub use crate::{
|
pub use crate::{
|
||||||
backing::{ImportBacking, LocalBacking},
|
backing::{ImportBacking, LocalBacking},
|
||||||
module::ModuleInner,
|
module::ModuleInner,
|
||||||
types::{
|
types::{LocalMemoryIndex, LocalOrImport, MemoryIndex, TableIndex},
|
||||||
MemoryIndex, LocalMemoryIndex, LocalOrImport,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
use std::{ffi::c_void, mem, ptr, slice};
|
use std::{ffi::c_void, mem, ptr, slice};
|
||||||
|
|
||||||
@ -35,7 +33,6 @@ pub struct Ctx {
|
|||||||
pub(crate) import_backing: *mut ImportBacking,
|
pub(crate) import_backing: *mut ImportBacking,
|
||||||
module: *const ModuleInner,
|
module: *const ModuleInner,
|
||||||
|
|
||||||
|
|
||||||
pub data: *mut c_void,
|
pub data: *mut c_void,
|
||||||
pub data_finalizer: Option<extern "C" fn(data: *mut c_void)>,
|
pub data_finalizer: Option<extern "C" fn(data: *mut c_void)>,
|
||||||
}
|
}
|
||||||
@ -97,7 +94,7 @@ impl Ctx {
|
|||||||
LocalOrImport::Local(local_mem_index) => {
|
LocalOrImport::Local(local_mem_index) => {
|
||||||
let local_backing = unsafe { &mut *self.local_backing };
|
let local_backing = unsafe { &mut *self.local_backing };
|
||||||
&mut local_backing.memories[local_mem_index][..]
|
&mut local_backing.memories[local_mem_index][..]
|
||||||
},
|
}
|
||||||
LocalOrImport::Import(import_mem_index) => {
|
LocalOrImport::Import(import_mem_index) => {
|
||||||
let import_backing = unsafe { &mut *self.import_backing };
|
let import_backing = unsafe { &mut *self.import_backing };
|
||||||
let vm_memory_import = import_backing.memories[import_mem_index].clone();
|
let vm_memory_import = import_backing.memories[import_mem_index].clone();
|
||||||
@ -106,7 +103,7 @@ impl Ctx {
|
|||||||
|
|
||||||
slice::from_raw_parts_mut(memory.base, memory.size)
|
slice::from_raw_parts_mut(memory.base, memory.size)
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user