mirror of
https://github.com/nginx/nginx.git
synced 2025-06-12 13:42:55 +08: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)
|
ngx_palloc_block(ngx_pool_t *pool, size_t size)
|
||||||
{
|
{
|
||||||
u_char *m;
|
u_char *m;
|
||||||
|
size_t psize;
|
||||||
ngx_pool_t *p, *new, *current;
|
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) {
|
if (new == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
new->d.end = (u_char *) new + psize;
|
||||||
|
new->d.next = NULL;
|
||||||
|
|
||||||
current = pool->current;
|
current = pool->current;
|
||||||
|
|
||||||
for (p = current; p->d.next; p = p->d.next) {
|
for (p = current; p->d.next; p = p->d.next) {
|
||||||
|
Loading…
Reference in New Issue
Block a user