question on ngx_reset_pool() 'current' pointer not reset

Maxim Dounin mdounin at mdounin.ru
Fri Jan 17 00:07:24 UTC 2014


Hello!

On Thu, Jan 16, 2014 at 02:56:53PM -0800, Ravi Chunduru wrote:

> Hi Nginx experts,
>   I am new to nginx and started looking into the code to understand the
> architecture.
> 
> Currently, I am looking into nginx pool implementation. I have a question
> on ngx_reset_pool().
> It seems to set back 'last' to the location as expected. But why 'current'
> and 'failed' are not reset.
> 
> Does it not make those memory blocks which are not no more referenced by
> parsing from 'current' made useless?

It looks like a bug.  Mostly harmless though - the 
ngx_reset_pool() is a function introduced specifically to save 
some memory while reading big geo databases.  Since introduction 
it's only used in the geo module, and I don't think it's possible 
to hit p->current != pool case there.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx-devel mailing list