Always Bump Downwards (2019)

When writing a bump allocator, the author suggests bumping downwards, which means allocating from high addresses to low addresses by decrementing the bump pointer. This method is more efficient than bumping upwards because it requires fewer registers, fewer instructions, and fewer conditional branches. Bump allocation is a super fast method for allocating objects, where a “bump pointer” is maintained within a chunk of memory. The trade off with bump allocation is that individual objects cannot be deallocated in the general case, but rather the bump pointer can be reset or moved in reverse to deallocate objects in a LIFO, stack order. The author also discusses the implementation of bump allocation in Rust and provides benchmarks that show the performance difference between bumping upwards and bumping downwards.

https://fitzgeraldnick.com/2019/11/01/always-bump-downwards.html

To top