diff src/core/ngx_slab.c @ 260:0effe91f6083 NGINX_0_5_0

nginx 0.5.0 *) Change: the parameters in the "%name" form in the "log_format" directive are not supported anymore. *) Change: the "proxy_upstream_max_fails", "proxy_upstream_fail_timeout", "fastcgi_upstream_max_fails", "fastcgi_upstream_fail_timeout", "memcached_upstream_max_fails", and "memcached_upstream_fail_timeout" directives are not supported anymore. *) Feature: the "server" directive in the "upstream" context supports the "max_fails", "fail_timeout", and "down" parameters. *) Feature: the "ip_hash" directive inside the "upstream" block. *) Feature: the WAIT status in the "Auth-Status" header line of the IMAP/POP3 proxy authentication server response. *) Bugfix: nginx could not be built on 64-bit platforms; bug appeared in 0.4.14.
author Igor Sysoev <http://sysoev.ru>
date Mon, 04 Dec 2006 00:00:00 +0300
parents 6ae1357b7b7c
children 29a6403156b0
line wrap: on
line diff
--- a/src/core/ngx_slab.c
+++ b/src/core/ngx_slab.c
@@ -149,8 +149,8 @@ void *
 ngx_slab_alloc(ngx_slab_pool_t *pool, size_t size)
 {
     size_t            s;
-    uintptr_t         p, mask, *bitmap;
-    ngx_uint_t        i, n, m, slot, shift, map;
+    uintptr_t         p, n, m, mask, *bitmap;
+    ngx_uint_t        i, slot, shift, map;
     ngx_slab_page_t  *page, *prev, *slots;
 
     ngx_shmtx_lock(&pool->mutex);
@@ -287,7 +287,7 @@ ngx_slab_alloc(ngx_slab_pool_t *pool, si
             do {
                 if ((page->slab & NGX_SLAB_MAP_MASK) != mask) {
 
-                    for (m = 1 << NGX_SLAB_MAP_SHIFT, i = 0;
+                    for (m = (uintptr_t) 1 << NGX_SLAB_MAP_SHIFT, i = 0;
                          m & mask;
                          m <<= 1, i++)
                     {
@@ -369,7 +369,7 @@ ngx_slab_alloc(ngx_slab_pool_t *pool, si
 
         } else { /* size < ngx_pagesize */
 
-            page->slab = (1 << NGX_SLAB_MAP_SHIFT) | shift;
+            page->slab = ((uintptr_t) 1 << NGX_SLAB_MAP_SHIFT) | shift;
             page->next = &slots[slot];
             page->prev = (uintptr_t) &slots[slot] | NGX_SLAB_BIG;