>>13Ah yeah I see it now.
Why doesn't this show up in the memory management literature? Latency seems very low, I'm guessing somewhere between RC with and RC without cycle collector. I've always liked RC because it runs at each return.
>>11From there, it's easy to have separate spaces for different purposes, and be able to independently reset each one to free up space.
Arenas.
https://en.wikipedia.org/wiki/Region-based_memory_managementeither by explicitly passing an allocator to each function that allocates memory, or implicitly by setting an allocator per environment
With arenas you usually have a default allocator and can override it (or in C, a utility function that bumps a pointer on the arena instead of calling malloc.) Keeps from having to tell things that won't outlive a stack frame where to allocate. This means you have your "per-level" data (good example) in an arena but other functions would use the standard allocator. The trick is: once the level is loaded, allocations are very rare outside of the arena and virtually nonexistent inside of it. You put re-usable object pools in the arena.