When programming in Odin you can use arena allocators. If you use an arena allocator combined with a dynamic array, then there are a couple of pitfalls that may not be apparent at first. Let’s look at what arenas are, how you can run into trouble when naively using them with dynamic arrays and what you can do instead.
What’s an arena? How does it work? Arenas and arena allocators are useful for grouping allocations that have the same lifetime.
Read in full here: