|
|
|
|
|
by dgb23
688 days ago
|
|
I like the part about memory management. Arenas are so simple. In the (toy) web server I'm writing I initially also started with arenas. However I quickly realized that I don't actually need to grow and shrink memory at all. Currently I'm simply allocating the memory I need up front then slice it up into pieces for every module. When we're programming, we often pretend like we could be needing arbitrary amounts of memory, but that's not necessarily the case. Many things actually have very clear limits. For the rest one can often define them. And if you enumerate those, you know how much memory you will need. It is fun to think about and define those limits up front. It builds a lot of confidence and promotes a healthy frugality. |
|
But it is very frequently possible to find the actual maximum you will need, allocate that upfront, and everything's great.