fix(wasm): use wee_alloc instead of stdlib malloc

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso
2025-04-23 23:47:39 -04:00
parent 1c4f2d1851
commit ea321b7f13
3 changed files with 56 additions and 1 deletions
+1
View File
@@ -4,3 +4,4 @@ version = "0.1.0"
edition = "2024"
[dependencies]
wee_alloc = "0.4"
+5
View File
@@ -1,5 +1,10 @@
use std::sync::{LazyLock, Mutex};
extern crate wee_alloc;
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
#[cfg(target_arch = "wasm32")]
mod hostimport {
use crate::{DATA_BUFFER, DATA_LENGTH};