3 ms·
"Batch allocation" in Rust is just a matter of Box-ing a custom-defined tuple of objects as opposed to putting each object in its own little Box. You can even
by zozbot234 11mo ago
"Batch allocation" in Rust is just a matter of Box-ing a custom-defined tuple of objects as opposed to putting each object in its own little Box. You can even include MaybeUninit's in the tuple that are then initialized later in unsafe code, and transmuted to the initialized type after-the-fact. You don't need an allocator library at all for this easy case, that's more valuable when the shape of allocations is in fact dynamic.
- kibwen 11mo ago> You don't need an allocator library at all for this easy case, that's more valuable when the shape of allocations is in fact dynamic. Though I'd still reach for something like Bumpalo ( https://crates.io/crates/bumpalo https://crates.io/crates/bumpalo ) unless I had good reason to avoid it.