Skip to content

Commit

Permalink
chore: use wee-alloc
Browse files Browse the repository at this point in the history
Signed-off-by: Lachezar Lechev <[email protected]>
  • Loading branch information
elpiel committed Feb 24, 2025
1 parent c8c238c commit 2a331d3
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
41 changes: 41 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions stremio-core-web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ wasm-bindgen = { version = "=0.2.100", features = ["serde-serialize"], optional
wasm-bindgen-futures = { version = "0.4.50", optional = true }
serde-wasm-bindgen = { version = "0.6.5", optional = true }

wee_alloc = "0.4"

once_cell = "1"

# panic hook for wasm
Expand Down
3 changes: 3 additions & 0 deletions stremio-core-web/src/stremio_core_web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ pub(crate) const SERIALIZER: serde_wasm_bindgen::Serializer =
static RUNTIME: Lazy<RwLock<Option<Loadable<Runtime<WebEnv, WebModel>, EnvError>>>> =
Lazy::new(Default::default);

#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;

#[wasm_bindgen(start)]
pub fn start() {
// print pretty errors in wasm https://github.com/rustwasm/console_error_panic_hook
Expand Down

0 comments on commit 2a331d3

Please sign in to comment.