lkml.org 
[lkml]   [2008]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fork_init: fix division by zero
On Wed, Dec 10, 2008 at 01:01:13PM +0300, Yuri Tikhonov wrote:

> >> + max_threads = mempages * PAGE_SIZE / (8 * THREAD_SIZE);
> > ^^^^^^^^^^^^^^^^^^^^
> >> +#endif
>
> > Can't this overflow, e.g. on 32-bit machines with HIGHMEM?
>
> The multiplier here is not PAGE_SIZE, but [PAGE_SIZE / (8 *
> THREAD_SIZE)], and this value is expected to be rather small (2, 4, or
> so).

x * y / z is parsed as (x * y) / z, not x * (y / z).

Only assignment operators (and ?:, in a sense that a ? b : c ? d : e is
parsed as a ? b : (c ? d : e)) are right-to-left. The rest is left-to-right.


\
 
 \ /
  Last update: 2008-12-10 11:21    [W:0.759 / U:0.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site