Earlier quoted context omitted.
I think that a blanket should/shouldn't recommendation for arenas isn't right. Arenas are a tradeoff: Pros: preallocating one arena is likely faster than many smaller allocations. Cons: preallocation is most effective if you can accurately predict usage for the arena; if you can't, then you either overshoot and allocate more memory than you need, or undershoot and have to reallocate which might be less performant tha…
>If you aren't preallocating and just using arenas for to free in a group, then I'm going to say using an arena for stuff that is going to be freed by the OS at program exit is adding complexity for no benefit What makes you think that the program is going to exit anytime soon? Arenas are useful if you want to execute a complex workflow and when it is over just blow away all the memory it accumulated. An HTTP server…
Because freeing memory in multiple exit paths of a short-running program is the definition of the problem he's trying to solve. Read what I posted before you waste everyone's time with another ego-based response where you don't admit you missed that important detail.
I'm well aware of what arenas are and they're an excellent tool for a lot of situations, maybe even most situations, but this isn't one of those situations.
Also be sure to let the authors of grep know their program used by millions of people is a toy program.