Skip to content

Commit 2a331d3

Browse files
committed
chore: use wee-alloc
Signed-off-by: Lachezar Lechev <[email protected]>
1 parent c8c238c commit 2a331d3

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

Cargo.lock

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

stremio-core-web/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ wasm-bindgen = { version = "=0.2.100", features = ["serde-serialize"], optional
4747
wasm-bindgen-futures = { version = "0.4.50", optional = true }
4848
serde-wasm-bindgen = { version = "0.6.5", optional = true }
4949

50+
wee_alloc = "0.4"
51+
5052
once_cell = "1"
5153

5254
# panic hook for wasm

stremio-core-web/src/stremio_core_web.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ pub(crate) const SERIALIZER: serde_wasm_bindgen::Serializer =
3636
static RUNTIME: Lazy<RwLock<Option<Loadable<Runtime<WebEnv, WebModel>, EnvError>>>> =
3737
Lazy::new(Default::default);
3838

39+
#[global_allocator]
40+
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
41+
3942
#[wasm_bindgen(start)]
4043
pub fn start() {
4144
// print pretty errors in wasm https://github.com/rustwasm/console_error_panic_hook

0 commit comments

Comments
 (0)