Skip to content

Commit

Permalink
change the global allocator to wee_alloc
Browse files Browse the repository at this point in the history
The default allocator (dlmalloc-rs) caused panic in workspaces with very
large number of files and bumping wasm-bindgen to latest didn't help.
See the issue:
alexcrichton/dlmalloc-rs#41
  • Loading branch information
rszyma committed Jun 1, 2024
1 parent a6892cc commit 7c564ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions kls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ anyhow = "^1.0.72"
serde_json = "^1.0.104"
unicode-segmentation = "1.10.1"
zduny-wasm-timer = "0.2.8"
wee_alloc = "0.4.5"

[dev-dependencies]
# wasm-bindgen-test = "0.3.39"
5 changes: 5 additions & 0 deletions kls/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
extern crate wee_alloc;

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

use crate::{
formatter::defsrc_layout::LineEndingSequence,
helpers::{lsp_range_from_span, HashSet},
Expand Down

0 comments on commit 7c564ea

Please sign in to comment.