mirror of
https://github.com/nginx/nginx.git
synced 2026-10-22 20:11:17 +00:00
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:
parent
21dfe90a4e
commit
9d08bda415
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue