Mercurial > hg > nginx-ranges
diff src/core/ngx_slab.c @ 274:052a7b1d40e5 NGINX_0_5_7
nginx 0.5.7
*) Feature: the ssl_session_cache storage optimization.
*) Bugfixes in the "ssl_session_cache" and "limit_zone" directives.
*) Bugfix: the segmentation fault was occurred on start or while
reconfiguration if the "ssl_session_cache" or "limit_zone"
directives were used on 64-bit platforms.
*) Bugfix: a segmentation fault occurred if the "add_before_body" or
"add_after_body" directives were used and there was no
"Content-Type" header line in response.
*) Bugfix: the OpenSSL library was always built with the threads
support.
Thanks to Den Ivanov.
*) Bugfix: the PCRE-6.5+ library and the icc compiler compatibility.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 15 Jan 2007 00:00:00 +0300 |
parents | 29a6403156b0 |
children | e10168d6e371 |
line wrap: on
line diff
--- a/src/core/ngx_slab.c +++ b/src/core/ngx_slab.c @@ -128,7 +128,7 @@ ngx_slab_init(ngx_slab_pool_t *pool) pool->pages->prev = (uintptr_t) &pool->free; pool->start = (u_char *) - ngx_align((uintptr_t) p + pages * sizeof(ngx_slab_page_t), + ngx_align_ptr((uintptr_t) p + pages * sizeof(ngx_slab_page_t), ngx_pagesize); m = pages - (pool->end - pool->start) / ngx_pagesize; @@ -295,7 +295,7 @@ ngx_slab_alloc_locked(ngx_slab_pool_t *p n = ngx_pagesize_shift - (page->slab & NGX_SLAB_SHIFT_MASK); n = 1 << n; - n = (1 << n) - 1; + n = ((uintptr_t) 1 << n) - 1; mask = n << NGX_SLAB_MAP_SHIFT; do { @@ -421,8 +421,8 @@ void ngx_slab_free_locked(ngx_slab_pool_t *pool, void *p) { size_t size; - uintptr_t slab, *bitmap; - ngx_uint_t n, m, type, slot, shift, map; + uintptr_t slab, m, *bitmap; + ngx_uint_t n, type, slot, shift, map; ngx_slab_page_t *slots, *page; ngx_log_debug1(NGX_LOG_DEBUG_ALLOC, ngx_cycle->log, 0, "slab free: %p", p); @@ -450,7 +450,7 @@ ngx_slab_free_locked(ngx_slab_pool_t *po } n = ((uintptr_t) p & (ngx_pagesize - 1)) >> shift; - m = 1 << (n & (sizeof(uintptr_t) * 8 - 1)); + m = (uintptr_t) 1 << (n & (sizeof(uintptr_t) * 8 - 1)); n /= (sizeof(uintptr_t) * 8); bitmap = (uintptr_t *) ((uintptr_t) p & ~(ngx_pagesize - 1)); @@ -476,7 +476,7 @@ ngx_slab_free_locked(ngx_slab_pool_t *po n = 1; } - if (bitmap[0] & ~((1 << n) - 1)) { + if (bitmap[0] & ~(((uintptr_t) 1 << n) - 1)) { goto done; } @@ -497,7 +497,8 @@ ngx_slab_free_locked(ngx_slab_pool_t *po case NGX_SLAB_EXACT: - m = 1 << (((uintptr_t) p & (ngx_pagesize - 1)) >> ngx_slab_exact_shift); + m = (uintptr_t) 1 << + (((uintptr_t) p & (ngx_pagesize - 1)) >> ngx_slab_exact_shift); size = ngx_slab_exact_size; if ((uintptr_t) p & (size - 1)) { @@ -539,8 +540,8 @@ ngx_slab_free_locked(ngx_slab_pool_t *po goto wrong_chunk; } - m = 1 << ((((uintptr_t) p & (ngx_pagesize - 1)) >> shift) - + NGX_SLAB_MAP_SHIFT); + m = (uintptr_t) 1 << ((((uintptr_t) p & (ngx_pagesize - 1)) >> shift) + + NGX_SLAB_MAP_SHIFT); if (slab & m) {