mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-08 05:38:19 +00:00
Simplify Global new
This commit is contained in:
3
lib/api/src/externals/global.rs
vendored
3
lib/api/src/externals/global.rs
vendored
@@ -31,7 +31,8 @@ impl Global {
|
||||
if !val.comes_from_same_store(store) {
|
||||
return Err(RuntimeError::new("cross-`Store` globals are not supported"));
|
||||
}
|
||||
let from = Arc::new(RuntimeGlobal::new_with_value(mutability, val));
|
||||
let from = Arc::new(RuntimeGlobal::new(GlobalType { mutability, ty: val.ty() }));
|
||||
unsafe { from.set_unchecked(val).unwrap() };
|
||||
let definition = from.vmglobal();
|
||||
let exported = ExportGlobal { definition, from };
|
||||
Ok(Global {
|
||||
|
||||
Reference in New Issue
Block a user