diff options
author | Igor Sysoev <igor@sysoev.ru> | 2007-11-16 21:15:04 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2007-11-16 21:15:04 +0300 |
commit | 499c05a87bc2b747d2dbb98cc6982f31b3c87f78 (patch) | |
tree | 4404262f5733fe9d1b591516c0d77aa99e1e01c8 /src/core/ngx_slab.c | |
parent | 5589bcf969a9324fee6cc68111212ef422c85b21 (diff) |
the simple expression has the same precision without overflow
Diffstat (limited to 'src/core/ngx_slab.c')
-rw-r--r-- | src/core/ngx_slab.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/core/ngx_slab.c b/src/core/ngx_slab.c index daf563913..9f63a91eb 100644 --- a/src/core/ngx_slab.c +++ b/src/core/ngx_slab.c @@ -111,10 +111,7 @@ ngx_slab_init(ngx_slab_pool_t *pool) p += n * sizeof(ngx_slab_page_t); - /* STUB: possible overflow on 64-bit platform */ - pages = (ngx_uint_t) ((uint64_t) size * ngx_pagesize - / (ngx_pagesize + sizeof(ngx_slab_page_t)) - / ngx_pagesize); + pages = (ngx_uint_t) (size / (ngx_pagesize + sizeof(ngx_slab_page_t))); ngx_memzero(p, pages * sizeof(ngx_slab_page_t)); |