Core: use ngx_palloc_small() to allocate ngx_pool_large_t.

This structure cannot be allocated as a large block anyway, otherwise that will
result in infinite recursion, since each large allocation requires to allocate
another ngx_pool_large_t.

The room for the structure is guaranteed by the NGX_MIN_POOL_SIZE constant.
This commit is contained in:
Valentin Bartenev 2016-03-23 17:44:04 +03:00
parent 21dfe90a4e
commit 9d08bda415

View File

@ -231,7 +231,7 @@ ngx_palloc_large(ngx_pool_t *pool, size_t size)
}
}
large = ngx_palloc(pool, sizeof(ngx_pool_large_t));
large = ngx_palloc_small(pool, sizeof(ngx_pool_large_t), 1);
if (large == NULL) {
ngx_free(p);
return NULL;
@ -256,7 +256,7 @@ ngx_pmemalign(ngx_pool_t *pool, size_t size, size_t alignment)
return NULL;
}
large = ngx_palloc(pool, sizeof(ngx_pool_large_t));
large = ngx_palloc_small(pool, sizeof(ngx_pool_large_t), 1);
if (large == NULL) {
ngx_free(p);
return NULL;