I recently implemented a compacting garbage collected arena in C, was surprised at how simple it was to make (though I need to still improve some things). I wonder why it's not used more? Just keep the really huge non-temp data buffers in a different datastructure so they don't need to be compacted, otherwise you can go wild with allocations and never have a use-after-free.
- Don't have to think about this stuff, no matter how the AST is manipulated.
- Get locality for free from live objects being compacted together
A pretty good deal!