12 releases

0.2.6 Mar 1, 2024
0.2.4 Aug 17, 2022
0.2.3 Nov 8, 2021
0.2.1 Nov 9, 2020
0.1.1 Nov 21, 2018

#27 in Memory management

Download history 52567/week @ 2024-03-02 58558/week @ 2024-03-09 57092/week @ 2024-03-16 56480/week @ 2024-03-23 61672/week @ 2024-03-30 64780/week @ 2024-04-06 57190/week @ 2024-04-13 56139/week @ 2024-04-20 45383/week @ 2024-04-27 46349/week @ 2024-05-04 54514/week @ 2024-05-11 53266/week @ 2024-05-18 64198/week @ 2024-05-25 59009/week @ 2024-06-01 57481/week @ 2024-06-08 50979/week @ 2024-06-15

240,814 downloads per month
Used in 27 crates (12 directly)

MIT/Apache

310KB
6K SLoC

C 3.5K SLoC // 0.4% comments Rust 2K SLoC // 0.0% comments

dlmalloc-rs

A port of dlmalloc to Rust.

Documentation

Why dlmalloc?

This crate is a port of dlmalloc to Rust, and doesn't rely on C. The primary purpose of this crate is to serve as the default allocator for Rust on the wasm32-unknown-unknown target. At the time this was written the wasm target didn't support C code, so it was required to have a Rust-only solution.

This allocator is not the most performant by a longshot. It is primarily, I think, intended for being easy to port and easy to learn. I didn't dive too deep into the implementation when writing it, it's just a straight port of the C version.

It's unlikely that Rust code needs to worry/interact with this allocator in general. Most of the time you'll be manually switching to a different allocator :)

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0–9.5MB
~75K SLoC