author | Jonathan Watt <jwatt@jwatt.org> |
Mon, 30 Mar 2015 16:27:13 +0100 | |
changeset 236966 | fba3aaf06f106b4aa9aab2d6299b6b35abcf8df9 |
parent 236965 | 505c191fb5dc7de1f0cc5f2384b2a21c6dcdb742 |
child 236967 | 295db120bf1294195fdee467ba8fded9caae4842 |
push id | 57833 |
push user | jwatt@jwatt.org |
push date | Wed, 01 Apr 2015 10:36:33 +0000 |
treeherder | mozilla-inbound@fba3aaf06f10 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | ehsan |
bugs | 1147491 |
milestone | 40.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
mfbt/RollingMean.h | file | annotate | diff | comparison | revisions | |
xpcom/ds/TimeStamp.h | file | annotate | diff | comparison | revisions |
--- a/mfbt/RollingMean.h +++ b/mfbt/RollingMean.h @@ -81,17 +81,17 @@ public: } /** * Calculate the rolling mean. */ T mean() { MOZ_ASSERT(!empty()); - return T(mTotal / mValues.length()); + return T(mTotal / int64_t(mValues.length())); } bool empty() { return mValues.empty(); } /**
--- a/xpcom/ds/TimeStamp.h +++ b/xpcom/ds/TimeStamp.h @@ -176,16 +176,21 @@ public: return FromTicks(ticks); } private: // Block double multiplier (slower, imprecise if long duration) - Bug 853398. // If required, use MultDouble explicitly and with care. BaseTimeDuration operator*(const double aMultiplier) const = delete; + // Block double divisor (for the same reason, and because dividing by + // fractional values would otherwise invoke the int64_t variant, and rounding + // the passed argument can then cause divide-by-zero) - Bug 1147491. + BaseTimeDuration operator/(const double aDivisor) const = delete; + public: BaseTimeDuration MultDouble(double aMultiplier) const { return FromTicks(ValueCalculator::Multiply(mValue, aMultiplier)); } BaseTimeDuration operator*(const int32_t aMultiplier) const { return FromTicks(ValueCalculator::Multiply(mValue, aMultiplier));