Skip to content

Commit

Permalink
Dont suggest wee-alloc in docs
Browse files Browse the repository at this point in the history
`wee-alloc` should no longer be recommended because of a memory leak: rustwasm/wee_alloc#85

It appears that the project is abandoned and that this issue will not be fixed anytime soon.

Closes #614
  • Loading branch information
lukechu10 committed Oct 6, 2023
1 parent b53d6f1 commit 075e3a9
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions docs/next/advanced/optimize_wasm_size.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,6 @@ A common mistake when building a Wasm binary is to forget to build in release mo
trunk build --release
```

## `wee_alloc`

[`wee_alloc`](https://github.com/rustwasm/wee_alloc) is a memory allocator focused on targeting
WebAssembly, producing a small .wasm code size, and having a simple, correct implementation.
Replacing the default allocator with this one will result in a smaller binary size at the expense of
speed and memory overhead.

```rust
// Use `wee_alloc` as the global allocator.
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
```

## `Cargo.toml`

It is possible to configure release builds to be smaller by using various flags and configurations
Expand Down

0 comments on commit 075e3a9

Please sign in to comment.