Re:Some were meant for C [pdf]
by k0k0r0 on Wednesday June 21, 2023 @07:53PM
(#36426407)
My assumption is that @chubot ment that malloc'ing each time you need some memory has been bad practise ever since. Mostly, pre-allocating stuff for whatever you need is the way to go, but that is not far away from writing general purpose arenas. At least not conceptually. So, arenas are nothing new (I guess... I had not been around back than).
[ Parent
| on HN ]
Re:Some were meant for C [pdf]
by abnercoimbre on Wednesday June 21, 2023 @08:40PM
(#36426714)
Indeed, arenas are not a new invention, but to quote a knowledgeable friend who's been around longer than us:
> you can find, for example, spolsky writing about [arenas] in 2003
Game engine, embedded, and OS people certainly knew about them. But this is the crucial point:
> it's possible for many people to know/use them, and also for most people not to know/use them
I grew up on Linux forum boards -- with lots of greybeards writing C -- and I was never once exposed to arenas (or bump / linear allocators.)
In school we wrote fairly complex programs in C, and professors were OK with forests of mallocs: despite most bugs stemming from them.