4 ms·
Slightly off-topic, I remember working with an apache library years ago, and I loved the idea of memory pools. Basically, create a memory pool. Then all memor
by m463 2y ago
Slightly off-topic, I remember working with an apache library years ago, and I loved the idea of memory pools.
Basically, create a memory pool.
Then all memory operations such as malloc and free are associated with that memory pool.
When you were done, you could release the memory pool and everything, every allocation, would magically be cleaned up.
It probably makes more sense in the context of a web server request... the request gets a memory pool, all memory allocations/deallocations belong to it, and if there is some sort of error, everything is easily cleaned up.
- anacrolix 2y agoCheck out Zig