mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-27 23:51:33 +00:00
Add importable memories and dynamic memories
This commit is contained in:
@ -1,8 +1,9 @@
|
||||
use crate::{
|
||||
instance::InstanceInner,
|
||||
memory::Memory,
|
||||
module::ExportIndex,
|
||||
module::ModuleInner,
|
||||
types::{FuncSig, GlobalDesc, Memory, Table},
|
||||
types::{FuncSig, GlobalDesc, TableDesc},
|
||||
vm,
|
||||
};
|
||||
use hashbrown::hash_map;
|
||||
@ -20,19 +21,15 @@ pub enum Export {
|
||||
ctx: Context,
|
||||
signature: FuncSig,
|
||||
},
|
||||
Memory {
|
||||
local: MemoryPointer,
|
||||
ctx: Context,
|
||||
memory: Memory,
|
||||
},
|
||||
Memory(Memory),
|
||||
Table {
|
||||
local: TablePointer,
|
||||
ctx: Context,
|
||||
table: Table,
|
||||
desc: TableDesc,
|
||||
},
|
||||
Global {
|
||||
local: GlobalPointer,
|
||||
global: GlobalDesc,
|
||||
desc: GlobalDesc,
|
||||
},
|
||||
}
|
||||
|
||||
@ -52,22 +49,6 @@ impl FuncPointer {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct MemoryPointer(*mut vm::LocalMemory);
|
||||
|
||||
impl MemoryPointer {
|
||||
/// This needs to be unsafe because there is
|
||||
/// no way to check whether the passed function
|
||||
/// is valid and has the right signature.
|
||||
pub unsafe fn new(f: *mut vm::LocalMemory) -> Self {
|
||||
MemoryPointer(f)
|
||||
}
|
||||
|
||||
pub(crate) fn inner(&self) -> *mut vm::LocalMemory {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct TablePointer(*mut vm::LocalTable);
|
||||
|
||||
|
Reference in New Issue
Block a user