small optimization
This commit is contained in:
parent
d47c831491
commit
e5f335d391
1 changed files with 7 additions and 1 deletions
|
@ -154,13 +154,19 @@ static void *
|
|||
ngx_palloc_block(ngx_pool_t *pool, size_t size)
|
||||
{
|
||||
u_char *m;
|
||||
size_t psize;
|
||||
ngx_pool_t *p, *new, *current;
|
||||
|
||||
new = ngx_create_pool((size_t) (pool->d.end - (u_char *) pool), pool->log);
|
||||
psize = (size_t) (pool->d.end - (u_char *) pool);
|
||||
|
||||
new = ngx_alloc(size, pool->log);
|
||||
if (new == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
new->d.end = (u_char *) new + psize;
|
||||
new->d.next = NULL;
|
||||
|
||||
current = pool->current;
|
||||
|
||||
for (p = current; p->d.next; p = p->d.next) {
|
||||
|
|
Loading…
Reference in a new issue