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.
diff --git a/src/core/ngx_palloc.c b/src/core/ngx_palloc.c index 587a1e5..91e7cd7 100644 --- a/src/core/ngx_palloc.c +++ b/src/core/ngx_palloc.c
@@ -231,7 +231,7 @@ } } - 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 @@ 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;