7016998: gcutil class LinearLeastSquareFit doesn't initialize some of its fields
authorphh
Thu, 03 Feb 2011 16:06:01 -0500
changeset 8104 f51b1f1750ac
parent 8103 65eafe3fb3c7
child 8105 d5bd38a11ccd
child 8295 a2b2a8a3aaee
7016998: gcutil class LinearLeastSquareFit doesn't initialize some of its fields Summary: Initialize _sum_x_squared, _intercept and _slope in constructor. Reviewed-by: bobv, coleenp
hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp
--- a/hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp	Wed Feb 02 10:41:20 2011 -0800
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp	Thu Feb 03 16:06:01 2011 -0500
@@ -106,8 +106,8 @@
 }
 
 LinearLeastSquareFit::LinearLeastSquareFit(unsigned weight) :
-  _sum_x(0), _sum_y(0), _sum_xy(0),
-  _mean_x(weight), _mean_y(weight) {}
+  _sum_x(0), _sum_x_squared(0), _sum_y(0), _sum_xy(0),
+  _intercept(0), _slope(0), _mean_x(weight), _mean_y(weight) {}
 
 void LinearLeastSquareFit::update(double x, double y) {
   _sum_x = _sum_x + x;