feat: Implement MemoryUsage for Instance.

This commit is contained in:
Ivan Enderlin
2021-03-22 15:46:40 +01:00
parent 768adb9360
commit 906079fd9d
17 changed files with 65 additions and 20 deletions

View File

@@ -5,6 +5,7 @@ use crate::types::Val;
use crate::GlobalType;
use crate::Mutability;
use crate::RuntimeError;
use loupe_derive::MemoryUsage;
use std::fmt;
use std::sync::Arc;
use wasmer_engine::{Export, ExportGlobal};
@@ -16,7 +17,7 @@ use wasmer_vm::{Global as RuntimeGlobal, VMExportGlobal};
/// It consists of an individual value and a flag indicating whether it is mutable.
///
/// Spec: <https://webassembly.github.io/spec/core/exec/runtime.html#global-instances>
#[derive(Clone)]
#[derive(Clone, MemoryUsage)]
pub struct Global {
store: Store,
global: Arc<RuntimeGlobal>,