3 ms·
How so? I've been using arena allocation with the bumpalo crate [1] with great success. I also wrote my own arena allocator for a WASM project, and also wrapped
by whytevuhuni 2y ago
How so? I've been using arena allocation with the bumpalo crate [1] with great success. I also wrote my own arena allocator for a WASM project, and also wrapped Nginx's memory pool via safe APIs.
I'm not going to claim that writing one correctly is easy... much like writing any low-level allocators, you have to deal with layout, drop order, unsafe cells, etc.
But using them? The lifetimes work great with them. And the allocator trait [2], once released, will make it so std collection types can be used as well.
[1] https://docs.rs/bumpalo https://docs.rs/bumpalo
[2] https://doc.rust-lang.org/std/alloc/trait.Allocator.html https://doc.rust-lang.org/std/alloc/trait.Allocator.html