I've been using the Memory Arena stuff in a project of my own, now I ran into something which I am not sure how to solve the 'proper' way:
Same as Casey i am using a scratch arena and a persistent arena,
I've been building some pathfinding code that uses the scratch arena during its run and then returns a linked list of Nodes
In my Game State / persistent arena i have an array of Actors that each possibly have a Path to follow.
I am not completely sure how to fix this, off course I can copy the linked list of Nodes (that lived in Scratch) into some new structure (because that scratch arena will be cleared much earlier then the path will be done with), but i don't really know of a way to have some memory in use for as long as i need it and then return it to the arena.
Both the persistent arena and the scratch are not really suited for that. what i am doing now is just give all the Path structs for the Actors a fixed size with quite some margin so short paths but also very long ones will fit, but this feels very wasteful (as in 100Mb vs 3Mb kind of wasteful), its by far the biggest chunk of memory at the moment. And most of the time all that memory is not used (many paths are like 4 nodes long, but i still reserve 512 nodes for it :))
Is this being tackled somewhere in the stream? If not what would your advice be?