Skip to content

Commit fb3962a

Browse files
committed
chore: Use wee_alloc for WASM
1 parent 4672591 commit fb3962a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

wasm/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ default-features = false
2525
url = "2"
2626
wasm-bindgen = { version = "0.2", features = ["serde-serialize"] }
2727
serde = { version = "1.0", features = ["derive"] }
28+
wee_alloc = "0.4"
2829
serde_derive = "1"
2930
serde_json = "1"
3031

wasm/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ use std::{
2828
};
2929
use wasm_bindgen::prelude::*;
3030

31+
#[global_allocator]
32+
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
33+
3134
struct InlineErrorWrapper(rust_inline::InlineError);
3235

3336
impl From<InlineErrorWrapper> for JsValue {

0 commit comments

Comments
 (0)