comparison src/core/ngx_slab.c @ 686:2e8a942c8872 NGINX_1_3_6

nginx 1.3.6 *) Feature: the ngx_http_gunzip_filter_module. *) Feature: the "memcached_gzip_flag" directive. *) Feature: the "always" parameter of the "gzip_static" directive. *) Bugfix: in the "limit_req" directive; the bug had appeared in 1.1.14. Thanks to Charles Chen. *) Bugfix: nginx could not be built by gcc 4.7 with -O2 optimization if the --with-ipv6 option was used.
author Igor Sysoev <http://sysoev.ru>
date Wed, 12 Sep 2012 00:00:00 +0400
parents 5cb5db9975ba
children
comparison
equal deleted inserted replaced
685:0a9f545d4f4b 686:2e8a942c8872
160 if (size >= ngx_slab_max_size) { 160 if (size >= ngx_slab_max_size) {
161 161
162 ngx_log_debug1(NGX_LOG_DEBUG_ALLOC, ngx_cycle->log, 0, 162 ngx_log_debug1(NGX_LOG_DEBUG_ALLOC, ngx_cycle->log, 0,
163 "slab alloc: %uz", size); 163 "slab alloc: %uz", size);
164 164
165 page = ngx_slab_alloc_pages(pool, (size + ngx_pagesize - 1) 165 page = ngx_slab_alloc_pages(pool, (size >> ngx_pagesize_shift)
166 >> ngx_pagesize_shift); 166 + ((size % ngx_pagesize) ? 1 : 0));
167 if (page) { 167 if (page) {
168 p = (page - pool->pages) << ngx_pagesize_shift; 168 p = (page - pool->pages) << ngx_pagesize_shift;
169 p += (uintptr_t) pool->start; 169 p += (uintptr_t) pool->start;
170 170
171 } else { 171 } else {