diff src/core/ngx_palloc.c @ 546:e19e5f542878 NGINX_0_8_25

nginx 0.8.25 *) Change: now no message is written in an error log if a variable is not found by $r->variable() method. *) Feature: the ngx_http_degradation_module. *) Feature: regular expression named captures. *) Feature: now URI part is not required a "proxy_pass" directive if variables are used. *) Feature: now the "msie_padding" directive works for Chrome too. *) Bugfix: a segmentation fault occurred in a worker process on low memory condition; the bug had appeared in 0.8.18. *) Bugfix: nginx sent gzipped responses to clients those do not support gzip, if "gzip_static on" and "gzip_vary off"; the bug had appeared in 0.8.16.
author Igor Sysoev <http://sysoev.ru>
date Mon, 16 Nov 2009 00:00:00 +0300
parents f7ec98e3caeb
children 2da4537168f8
line wrap: on
line diff
--- a/src/core/ngx_palloc.c
+++ b/src/core/ngx_palloc.c
@@ -17,7 +17,7 @@ ngx_create_pool(size_t size, ngx_log_t *
 {
     ngx_pool_t  *p;
 
-    p = ngx_memalign(ngx_pagesize, size, log);
+    p = ngx_memalign(ngx_min(ngx_pagesize, size), size, log);
     if (p == NULL) {
         return NULL;
     }
@@ -181,7 +181,7 @@ ngx_palloc_block(ngx_pool_t *pool, size_
 
     psize = (size_t) (pool->d.end - (u_char *) pool);
 
-    m = ngx_memalign(ngx_pagesize, psize, pool->log);
+    m = ngx_memalign(ngx_min(ngx_pagesize, psize), psize, pool->log);
     if (m == NULL) {
         return NULL;
     }
@@ -219,7 +219,7 @@ ngx_palloc_large(ngx_pool_t *pool, size_
     ngx_uint_t         n;
     ngx_pool_large_t  *large;
 
-    p = ngx_memalign(ngx_pagesize, size, pool->log);
+    p = ngx_alloc(size, pool->log);
     if (p == NULL) {
         return NULL;
     }