diff --git a/lib/wasmer-types/src/types.rs b/lib/wasmer-types/src/types.rs index 3f5d8f5d816..6bb3ee3704f 100644 --- a/lib/wasmer-types/src/types.rs +++ b/lib/wasmer-types/src/types.rs @@ -6,7 +6,7 @@ use crate::lib::std::string::{String, ToString}; use crate::lib::std::vec::Vec; use crate::units::Pages; use crate::values::Value; -use loupe::MemoryUsage; +use loupe::{MemoryUsage, MemoryUsageTracker}; #[cfg(feature = "enable-serde")] use serde::{Deserialize, Serialize}; @@ -57,7 +57,7 @@ impl fmt::Display for Type { } } -#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, MemoryUsage)] +#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)] #[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))] /// The WebAssembly V128 type pub struct V128(pub(crate) [u8; 16]); @@ -98,6 +98,12 @@ impl From<&[u8]> for V128 { } } +impl MemoryUsage for V128 { + fn size_of_val(&self, tracker: &mut dyn MemoryUsageTracker) -> usize { + self.as_slice().size_of_val(tracker) + } +} + // External Types /// A list of all possible types which can be externally referenced from a