Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2016-03-23 17:44:04 +0300
committerValentin Bartenev <vbart@nginx.com>2016-03-23 17:44:04 +0300
commit9d08bda415b9c987b7a3503bf5fa45cfda15df2e (patch)
tree4ac5e2585ab902d4815005b9a2411ebdc49c0a32 /src/core/ngx_palloc.c
parent21dfe90a4e7015c0e6530208c2e6a4d8a9284ce1 (diff)
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.
Diffstat (limited to 'src/core/ngx_palloc.c')
-rw-r--r--src/core/ngx_palloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/ngx_palloc.c b/src/core/ngx_palloc.c
index 587a1e587..91e7cd71c 100644
--- a/src/core/ngx_palloc.c
+++ b/src/core/ngx_palloc.c
@@ -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;