mirror of
https://github.com/nginx/nginx.git
synced 2024-12-02 20:09:01 +08:00
Core: improved ngx_reset_pool() (ticket #490).
Previously pool->current wasn't moved back to pool, resulting in blocks not used for further allocations if pool->current was already moved at the time of ngx_reset_pool(). Additionally, to preserve logic of moving pool->current, the p->d.failed counters are now properly cleared. While here, pool->chain is also cleared. This change is essentially a nop with current code, but generally improves things.
This commit is contained in:
parent
1ef5553644
commit
0bfb68eea0
@ -105,11 +105,14 @@ ngx_reset_pool(ngx_pool_t *pool)
|
||||
}
|
||||
}
|
||||
|
||||
pool->large = NULL;
|
||||
|
||||
for (p = pool; p; p = p->d.next) {
|
||||
p->d.last = (u_char *) p + sizeof(ngx_pool_t);
|
||||
p->d.failed = 0;
|
||||
}
|
||||
|
||||
pool->current = pool;
|
||||
pool->chain = NULL;
|
||||
pool->large = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user