3 ms·
Sure, but if you're not freeing memory you don't need a real malloc. You allocation function can be just "top += allocsize".
by cperciva 8y ago
Sure, but if you're not freeing memory you don't need a real malloc. You allocation function can be just "top += allocsize".
- wrs 8y agoYes, that's commonly known as "arena allocation" and has been used for decades in programs that have well-defined phases that create lots of connected objects with the same lifetime, like compiler passes, RPC serialization layers, or query planners.