mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-23 05:31:32 +00:00
Remove memory_offset_addr impl
This commit is contained in:
@ -345,23 +345,6 @@ impl Namespace for Instance {
|
|||||||
// TODO Remove this later, only needed for compilation till emscripten is updated
|
// TODO Remove this later, only needed for compilation till emscripten is updated
|
||||||
impl Instance {
|
impl Instance {
|
||||||
pub fn memory_offset_addr(&self, index: usize, offset: usize) -> *const u8 {
|
pub fn memory_offset_addr(&self, index: usize, offset: usize) -> *const u8 {
|
||||||
// Get vm context.
|
unimplemented!()
|
||||||
let vmctx = &self.vmctx;
|
|
||||||
|
|
||||||
// Check if the index specified refers to an imported memory.
|
|
||||||
if index < self.module.0.imported_memories.len() {
|
|
||||||
// Get imported memory at specified index.
|
|
||||||
let memory = unsafe { vmctx.imported_memories.add(index) };
|
|
||||||
|
|
||||||
// Get the actual address of the specified offset.
|
|
||||||
return unsafe { (*(*memory).memory).base.add(offset) }
|
|
||||||
}
|
|
||||||
|
|
||||||
// Index points to a locally-defined memory
|
|
||||||
// Get local memory at specified index.
|
|
||||||
let memory = unsafe { vmctx.memories.add(index) };
|
|
||||||
|
|
||||||
// Get the actual address of the specified offset.
|
|
||||||
unsafe { (*memory).base.add(offset) }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ pub struct ModuleInner {
|
|||||||
pub sig_registry: SigRegistry,
|
pub sig_registry: SigRegistry,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Module(pub Rc<ModuleInner>);
|
pub struct Module(Rc<ModuleInner>);
|
||||||
|
|
||||||
impl Module {
|
impl Module {
|
||||||
pub(crate) fn new(inner: Rc<ModuleInner>) -> Self {
|
pub(crate) fn new(inner: Rc<ModuleInner>) -> Self {
|
||||||
|
Reference in New Issue
Block a user