Arena allocator tips and tricks (nullprogram.com)
from tedu@inks.tedunangst.com to inks@inks.tedunangst.com on 01 Oct 2023 18:51
https://inks.tedunangst.com/l/5043

Over the past year I’ve refined my approach to arena allocation. With practice, it’s effective, simple, and fast; typically as easy to use as garbage collection but without the costs. Depending on need, an allocator can weigh just 7–25 lines of code — perfect when lacking a runtime. With the core details of my own technique settled, now is a good time to document and share lessons learned. This is certainly not the only way to approach arena allocation, but these are practices I’ve worked out to simplify programs and reduce mistakes.

See also: https://nullprogram.com/blog/2023/09/30/

An easy-to-implement, arena-friendly hash map

#c #development #hash #malloc #programming

#c #development #hash #inks #malloc #programming

threaded - newest