From 8ca9c3580990bc973218d944f2262a7d98a8380e Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 8 Aug 2026 23:45:00 +0200 Subject: chore: general cleanup, fix performance regressions Signed-off-by: Henry --- crates/types/src/types.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/types') diff --git a/crates/types/src/types.rs b/crates/types/src/types.rs index 214ada6..0801849 100644 --- a/crates/types/src/types.rs +++ b/crates/types/src/types.rs @@ -1,4 +1,4 @@ -use alloc::boxed::Box; +use alloc::{boxed::Box, sync::Arc}; use crate::{TypeAddr, WasmType}; @@ -100,7 +100,7 @@ impl CompositeType { #[cfg_attr(feature = "debug", derive(Debug))] #[cfg_attr(feature = "archive", derive(serde::Serialize, serde::Deserialize))] pub struct FuncType { - data: Box<[WasmType]>, + data: Arc<[WasmType]>, param_count: u16, } @@ -108,7 +108,7 @@ impl FuncType { /// Create a new function type. pub fn new(params: &[WasmType], results: &[WasmType]) -> Self { let data: Box<[WasmType]> = params.iter().cloned().chain(results.iter().cloned()).collect(); - Self { data, param_count: params.len() as u16 } + Self { data: data.into(), param_count: params.len() as u16 } } /// Get the parameter types of this function type. -- cgit v1.3.1