do not try to align to a page size, allocate just 8K,
this is fixes allocation on Cygwin, it reports 64K page size
Igor Sysoev
13 years ago
937 | 937 | |
938 | 938 | alloc = items * size; |
939 | 939 | |
940 | if (alloc % 512 != 0) { | |
940 | if (alloc % 512 != 0 && alloc < 8192) { | |
941 | 941 | |
942 | 942 | /* |
943 | 943 | * The zlib deflate_state allocation, it takes about 6K, |
944 | 944 | * we allocate 8K. Other allocations are divisible by 512. |
945 | 945 | */ |
946 | 946 | |
947 | alloc = (alloc + ngx_pagesize - 1) & ~(ngx_pagesize - 1); | |
947 | alloc = 8192; | |
948 | 948 | } |
949 | 949 | |
950 | 950 | if (alloc <= ctx->allocated) { |