mirror of
https://github.com/nginx/nginx.git
synced 2026-08-28 12:45:21 +00:00
the simple expression has the same precision without overflow
This commit is contained in:
parent
5589bcf969
commit
499c05a87b
1 changed files with 1 additions and 4 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue