From: Ian Jackson Date: Sun, 6 Mar 2022 14:16:17 +0000 (+0000) Subject: wasm: No not use wee-alloc. It has bugs and seems unmaintained X-Git-Tag: otter-1.0.0~141 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=6d4817a67086c1254b757c38f2b240bc03b2f36a;p=otter.git wasm: No not use wee-alloc. It has bugs and seems unmaintained --- diff --git a/Cargo.lock b/Cargo.lock index 2eb745db..25df317c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2016,12 +2016,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mime" version = "0.2.6" @@ -2608,7 +2602,6 @@ dependencies = [ "otter-base", "wasm-bindgen", "wasm-bindgen-cli", - "wee_alloc", ] [[package]] @@ -4856,18 +4849,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi 0.3.9", -] - [[package]] name = "winapi" version = "0.2.8" diff --git a/wasm/Cargo.toml b/wasm/Cargo.toml index 65f6f6db..901a8e4a 100644 --- a/wasm/Cargo.toml +++ b/wasm/Cargo.toml @@ -32,7 +32,6 @@ otter-base.version="=0.7.3" console_error_panic_hook="0.1" fehler="1" js-sys="0.3" -wee_alloc="0.4" wasm-bindgen = { version = "0.2", features = ["serde-serialize"] } diff --git a/wasm/wasm.rs b/wasm/wasm.rs index ddb946fe..88dbd4b9 100644 --- a/wasm/wasm.rs +++ b/wasm/wasm.rs @@ -216,6 +216,11 @@ pub fn setup(s: &str) -> JsString { format!("WASM {}", s).into() } -//#[cfg(feature = "wee_alloc")] -#[global_allocator] -static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; +// wee-alloc has a null pointer deref here +// 846 | assert_local_cell_invariants(&(*current_free).header); +// this is apparently known about +// https://githubplus.com/saethlin/miri-tools +// and wee-alloc has not been updated in over a year. +// This was saving us 7k in the output wasm file, out of 140k. +//#[global_allocator] +//static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;