Implement wasm_global_type (#898)
This commit is contained in:
@@ -1422,6 +1422,16 @@ pub unsafe extern "C" fn wasm_global_new(
|
||||
Box::into_raw(g)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasm_global_type(g: *const wasm_global_t) -> *mut wasm_globaltype_t {
|
||||
let globaltype = (*g).global().borrow().ty().clone();
|
||||
let g = Box::new(wasm_globaltype_t {
|
||||
globaltype,
|
||||
content_cache: None,
|
||||
});
|
||||
Box::into_raw(g)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasm_global_get(g: *const wasm_global_t, out: *mut wasm_val_t) {
|
||||
(*out).set((*g).global().borrow().get());
|
||||
|
||||
Reference in New Issue
Block a user