C Programming Guidelines
For memory allocation you often don't need to use malloc. Many (most?) programs can mmap a large region of memory and allocate from that. Then when you're done you just unmap the region. This is much easier to use since you only have to remember to unmap once as opposed to handling each allocated pointer individually.<p>Edit: Here is a paper that touches a bit on what I'm describing: <a href="http://people.cs.umass.edu/~emery/pubs/berger-oopsla2002.pdf" rel="nofollow">http://people.cs.umass.edu/~emery/pubs/berger-oopsla2002.pdf</a><p>Also, to clarify, I'm not saying allocate yourself a big piece of memory and then reimplement malloc on top of that. You literally just get a big piece of memory and every time you want to allocate something new from it add the offset to the base address, return that to the user, and store the new offset.