Bug 713773 - Ensure GC statistics counters are initialized (r=igor)
authorBill McCloskey <wmccloskey@mozilla.com>
Tue, 27 Dec 2011 18:42:31 -0800
changeset 83420 35674d1a5efba2e309b58e3302242b8b5b3b6bb3
parent 83419 994d41f8225738de17b062746686a88fd0289d75
child 83421 9c78b487233347155c1dd02d8a7f251a24db4aae
push id21760
push usermbrubeck@mozilla.com
push dateWed, 28 Dec 2011 19:04:19 +0000
treeherdermozilla-central@010fe7e7df1a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersigor
bugs713773
milestone12.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
Bug 713773 - Ensure GC statistics counters are initialized (r=igor)
js/src/gc/Statistics.cpp
--- a/js/src/gc/Statistics.cpp
+++ b/js/src/gc/Statistics.cpp
@@ -115,16 +115,21 @@ Statistics::makeTable(ColumnInfo *cols)
 
     JS_ASSERT(i == NUM_COLUMNS);
 }
 
 Statistics::Statistics(JSRuntime *rt)
   : runtime(rt)
   , triggerReason(PUBLIC_API) //dummy reason to satisfy makeTable
 {
+    PodArrayZero(counts);
+    PodArrayZero(totals);
+
+    startupTime = PRMJ_Now();
+
     char *env = getenv("MOZ_GCTIMER");
     if (!env || strcmp(env, "none") == 0) {
         fp = NULL;
         return;
     }
 
     if (strcmp(env, "stdout") == 0) {
         fullFormat = false;
@@ -141,21 +146,16 @@ Statistics::Statistics(JSRuntime *rt)
         fprintf(fp, "     AppTime");
 
         ColumnInfo cols[NUM_COLUMNS];
         makeTable(cols);
         for (int i = 0; i < NUM_COLUMNS; i++)
             fprintf(fp, ", %*s", cols[i].width, cols[i].title);
         fprintf(fp, "\n");
     }
-
-    PodArrayZero(counts);
-    PodArrayZero(totals);
-
-    startupTime = PRMJ_Now();
 }
 
 Statistics::~Statistics()
 {
     if (fp) {
         if (fullFormat) {
             fprintf(fp, "------>TOTAL");