3 ms·
> C, C++ and Rust can't use a bump allocator since you need a compacting GC to do so. But allocations are really expensive in these languages and removing them
by jashmatthews 9y ago
> C, C++ and Rust can't use a bump allocator since you need a compacting GC to do so. But allocations are really expensive in these languages and removing them is often the first step of optimization.
Not true. You can use exactly the same techniques in C, C++ and Rust. It's called arena based allocation.
Even malloc calls can be very cheap. The Hoard allocator uses bump pointer allocation for malloc into empty pages!