changeset 2057:24eebb21b5d2

fix max size allocated from pool
author Igor Sysoev <igor@sysoev.ru>
date Sat, 21 Jun 2008 06:40:32 +0000
parents 3ea9a03a1803
children 9992c4583513
files src/core/ngx_palloc.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/ngx_palloc.c
+++ b/src/core/ngx_palloc.c
@@ -26,8 +26,9 @@ ngx_create_pool(size_t size, ngx_log_t *
     p->d.end = (u_char *) p + size;
     p->d.next = NULL;
 
-    p->max = (size < NGX_MAX_ALLOC_FROM_POOL) ? size - sizeof(ngx_pool_t):
-                                                NGX_MAX_ALLOC_FROM_POOL;
+    size = size - sizeof(ngx_pool_t);
+    p->max = (size < NGX_MAX_ALLOC_FROM_POOL) ? size : NGX_MAX_ALLOC_FROM_POOL;
+
     p->current = p;
     p->chain = NULL;
     p->large = NULL;