Nginx - core utility - 3

ng's core utilities lie in the folder: src/core. Most of them are elegantly coded.

ngx_array_t :

Allocate space from specific memory pool, double the space if full. when need to destroy, shrink memory space to zero.

ngx_buf_t :

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.

ngx_conf_t :
to be continued ...

No comments:

Post a Comment