changeset 2425:3d60d55b9ad0

do not try to align to a page size, allocate just 8K, this is fixes allocation on Cygwin, it reports 64K page size
author Igor Sysoev <igor@sysoev.ru>
date Wed, 24 Dec 2008 12:05:55 +0000
parents 46d11bff21ef
children e5ef47ecab5d
files src/http/modules/ngx_http_gzip_filter_module.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/modules/ngx_http_gzip_filter_module.c
+++ b/src/http/modules/ngx_http_gzip_filter_module.c
@@ -938,14 +938,14 @@ ngx_http_gzip_filter_alloc(void *opaque,
 
     alloc = items * size;
 
-    if (alloc % 512 != 0) {
+    if (alloc % 512 != 0 && alloc < 8192) {
 
         /*
          * The zlib deflate_state allocation, it takes about 6K,
          * we allocate 8K.  Other allocations are divisible by 512.
          */
 
-        alloc = (alloc + ngx_pagesize - 1) & ~(ngx_pagesize - 1);
+        alloc = 8192;
     }
 
     if (alloc <= ctx->allocated) {