diff options
| author | Henry <mail@henrygressmann.de> | 2026-08-08 23:45:00 +0200 |
|---|---|---|
| committer | Henry <mail@henrygressmann.de> | 2026-08-08 23:45:37 +0200 |
| commit | 8ca9c3580990bc973218d944f2262a7d98a8380e (patch) | |
| tree | 7fcd0497363ea1ef1f77b02f3129e95881c5bc7f /crates/types | |
| parent | 676be92cde66d7c20bfe11d64bfc3f5762c4c46e (diff) | |
chore: general cleanup, fix performance regressions
Signed-off-by: Henry <mail@henrygressmann.de>
Diffstat (limited to 'crates/types')
| -rw-r--r-- | crates/types/src/types.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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. |
