logoalt Hacker News

lelanthranyesterday at 9:37 PM0 repliesview on HN

>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 is the textbook example; one arena per request, all memory freed when the request is completed, but there's many many more similar workflows in a running program.

Leaving it for program exit is a luxury only available to those writing toy programs.