Skip to content

Commit

Permalink
fix: 🔥 Removed wee_alloc to fix memory leak
Browse files Browse the repository at this point in the history
This is the same issue as encountered with deno_lz4 denosaurs/deno_lz4#1
  • Loading branch information
eliassjogreen committed Jun 1, 2020
1 parent c2a73f9 commit 4256de7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ lto = true
opt-level = "z"

[features]
default = ["wee_alloc"]
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use brotli::{CompressorWriter, DecompressorWriter};
use std::io::Write;
use wasm_bindgen::prelude::wasm_bindgen;

#[cfg(feature = "wee_alloc")]
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;

#[cfg(feature = "wee_alloc")]
#[wasm_bindgen]
pub fn compress(input: &[u8], buffer_size: usize, quality: u32, lgwin: u32) -> Vec<u8> {
let mut output = Vec::new();
Expand Down
2 changes: 1 addition & 1 deletion wasm.js

Large diffs are not rendered by default.

0 comments on commit 4256de7

Please sign in to comment.