6 releases

0.0.0-2023-05-28 Jan 26, 2024
0.0.0-2023-05-13 May 13, 2023
0.0.0-2023-05-06 May 7, 2023
0.0.0-2023-05-05 May 5, 2023
0.0.0-2023-05-03 May 3, 2023

#120 in Memory management

Download history 8/week @ 2024-01-22 6/week @ 2024-02-19 12/week @ 2024-02-26 6/week @ 2024-03-11 98/week @ 2024-04-01

104 downloads per month
Used in valrow

Apache-2.0 OR MIT

4.5K SLoC


Allocator interface traits for Rust

GitHub crates.io docs.rs unsafe: very License Build Status

Raison d'être

  • Why not core::alloc::Allocator / allocator_api?
    • 7+ years unstabilized and counting.
    • I want container allocations this decade, thanks!
    • We can aim to be compatible and interopable with it, if/when it stabilizes, or via separate nightly crates.
  • Why not core::alloc::GlobalAlloc?
    • Win32 FreeSid has no equivalent arbitrary allocation function to implement GlobalAlloc::alloc with.
    • bgfx::alloc has no equivalent arbitrary free function to implement GlobalAlloc::dealloc with.
    • Split alloc/free/realloc traits will help avoid bugs and misuse!
    • That said, we can aim to be compatible and interopable with it.
  • Rust-style traits are annoying to adapt to C-style allocators. This provides more C-friendly traits as options.

Out of scope

  • NUMA? Although ask again later.
  • Physical GPU memory allocation, probably. Might warrant a related crate?
  • ID/handle allocation, perhaps. Might warrant a related crate?


Licensed under either of

at your option.


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


~15K SLoC