Nginx - core utility - 3
ng's core utilities lie in the folder: src/core. Most of them are elegantly coded.
Allocate space from specific memory pool, double the space if full. when need to destroy, shrink memory space to zero.
One of the beautiful pieces. It supports chain of bufs, that is implemented as allocating one big cake first, and splice equally for each one scheme. When applying for a buf, return the current buf of the chain, or pcalloc one. And update chain operation is to move all elements in busy and out chains to head of free chain.
to be continued ...