mirror of
https://github.com/nginx/nginx.git
synced 2025-01-08 23:23:02 -06:00
the simple expression has the same precision without overflow
This commit is contained in:
parent
5589bcf969
commit
499c05a87b
@ -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));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user