fn snapshot_globals(
    ctx: &mut impl AsContextMut,
    instance: &wasmtime::Instance,
) -> Vec<wasmtime::Val> {
    log::debug!("Snapshotting global values");
    let mut globals = vec![];
    let mut index = 0;
    loop {
        let name = format!("__wizer_global_{}", index);
        match instance.get_global(&mut *ctx, &name) {
            None => break,
            Some(global) => {
                globals.push(global.get(&mut *ctx));
                index += 1;
            }
        }
    }
    globals
}
/// Get the initialized values of all globals.
Get the initialized values of all globals.
Get the initialized values of all globals .
fn snapshot_globals(
    ctx: &mut impl AsContextMut,
    instance: &wasmtime::Instance,
) -> Vec<wasmtime::Val> {
    log::debug!("Snapshotting global values");
    let mut globals = vec![];
    let mut index = 0;
    loop {
        let name = format!("__wizer_global_{}", index);
        match instance.get_global(&mut *ctx, &name) {
            None => break,
            Some(global) => {
                globals.push(global.get(&mut *ctx));
                index += 1;
            }
        }
    }
    globals
}
fn snapshot_globals ( ctx : & mut impl AsContextMut , instance : & wasmtime :: Instance , ) -> Vec < wasmtime :: Val > { log :: debug ! ( " " ) ; let mut globals = vec ! [ ] ; let mut index = 0 ; loop { let name = format ! ( " " index ) ; match instance . get_global ( & mut * ctx , & name ) { None => break , Some ( global ) => { globals . push ( global . get ( & mut * ctx ) ) ; index += 1 ; } } } globals }
Get the initialized values of all globals.
Get the initialized values of all globals .
ctx
&mut impl AsContextMut
instance
&wasmtime::Instance
ctx
&mut impl AsContextMut
instance
&wasmtime::Instance