mirror of
https://github.com/nginx/nginx.git
synced 2024-12-19 05:33:52 -06:00
small optimization
This commit is contained in:
parent
0b5e77f416
commit
5a4c61658b
@ -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 New Issue
Block a user