add typecast to avoid (unlikely but possible) integer overflows.
this will silence a lot of static code analysis warnings
This commit is contained in:
@ -520,7 +520,7 @@ void ComputeReduceChunk::unlock(Fix *fixptr)
|
||||
double ComputeReduceChunk::memory_usage()
|
||||
{
|
||||
double bytes = (bigint) maxatom * sizeof(double);
|
||||
if (nvalues == 1) bytes += (bigint) maxchunk * 2 * sizeof(double);
|
||||
else bytes += (bigint) maxchunk * nvalues * 2 * sizeof(double);
|
||||
if (nvalues == 1) bytes += (double) maxchunk * 2 * sizeof(double);
|
||||
else bytes += (double) maxchunk * nvalues * 2 * sizeof(double);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user