Registry / utility / wee-alloc

wee-alloc

JSON →
library0.4.5rscratesunverified

A small, WebAssembly-optimized memory allocator for Rust, designed for minimal code size.

# Cargo.toml [dependencies] wee_alloc = "0.4.5"
INSTALL
IMPORT
SIG · WEE-ALLOC
W
wee-alloc
utilityrustv0.4.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

WeeAlloc
use wee_alloc::WeeAlloc;

Sets wee_alloc as the global allocator for a WebAssembly target.

use wee_alloc::WeeAlloc; #[global_allocator] static ALLOC: WeeAlloc = WeeAlloc::INIT; fn main() { let v = vec![1, 2, 3]; println!("{:?}", v); }
Debug
Known issues
gotchaNot suitable for performance-critical applications; designed for size, not speed.
fix
Use a different allocator like `std::alloc::System` for non-WASM targets.
affects: >=0.4.0
Upgrade
Version history
0.4.5latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources