mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-27 23:51:33 +00:00
Add new global import api
This commit is contained in:
@ -1,9 +1,10 @@
|
||||
use crate::{
|
||||
global::Global,
|
||||
instance::InstanceInner,
|
||||
memory::Memory,
|
||||
module::ExportIndex,
|
||||
module::ModuleInner,
|
||||
types::{FuncSig, GlobalDesc, TableDesc},
|
||||
types::{FuncSig, TableDesc},
|
||||
vm,
|
||||
};
|
||||
use hashbrown::hash_map;
|
||||
@ -27,10 +28,7 @@ pub enum Export {
|
||||
ctx: Context,
|
||||
desc: TableDesc,
|
||||
},
|
||||
Global {
|
||||
local: GlobalPointer,
|
||||
desc: GlobalDesc,
|
||||
},
|
||||
Global(Global),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@ -65,22 +63,6 @@ impl TablePointer {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct GlobalPointer(*mut vm::LocalGlobal);
|
||||
|
||||
impl GlobalPointer {
|
||||
/// 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::LocalGlobal) -> Self {
|
||||
GlobalPointer(f)
|
||||
}
|
||||
|
||||
pub(crate) fn inner(&self) -> *mut vm::LocalGlobal {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ExportIter<'a> {
|
||||
inner: &'a mut InstanceInner,
|
||||
iter: hash_map::Iter<'a, String, ExportIndex>,
|
||||
|
Reference in New Issue
Block a user