Skip to content

Commit

Permalink
use wee_alloc
Browse files Browse the repository at this point in the history
  • Loading branch information
programingjd committed Nov 14, 2022
1 parent 4bebd21 commit 2f0fd3e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ edition = "2021"
[lib]
crate-type = ["cdylib","rlib"]

[features]
#default = ["console_error_panic_hook"]
[dependencies.wasm-bindgen]
version = "0.2"

[dependencies]
wasm-bindgen = "0.2"
#console_error_panic_hook = "0.1"
mashi-core = "0.1"
[dependencies.mashi-core]
version = "0.1"
features=["encoder"]
default-features=false

[dependencies.wee_alloc]
version = "0.4"

[profile.release]
opt-level = "s"
Expand Down
Binary file modified paq.wasm
Binary file not shown.
Binary file modified paq.wasm.br
Binary file not shown.
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ use mashi_core::{Decoder, Encoder};
// #[global_allocator]
// static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;

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

#[wasm_bindgen]
pub fn unpaq(data: &[u8]) -> Vec<u8> {
let mut decoder = Decoder::new();
Expand Down

0 comments on commit 2f0fd3e

Please sign in to comment.