diff options
-rw-r--r-- | base/statistics.hh | 1 | ||||
-rw-r--r-- | sim/sim_object.cc | 15 |
2 files changed, 12 insertions, 4 deletions
diff --git a/base/statistics.hh b/base/statistics.hh index fc3252782..f71e24672 100644 --- a/base/statistics.hh +++ b/base/statistics.hh @@ -528,7 +528,6 @@ struct AvgStor */ void reset() { - current = T(); total = 0; last = curTick; } diff --git a/sim/sim_object.cc b/sim/sim_object.cc index 5c8e3eb9b..b524d6075 100644 --- a/sim/sim_object.cc +++ b/sim/sim_object.cc @@ -131,6 +131,13 @@ SimObject::regAllStats() void SimObject::resetAllStats() { + SimObjectList::iterator i = simObjectList.begin(); + SimObjectList::iterator end = simObjectList.end(); + + for (; i != end; ++i) { + SimObject *obj = *i; + obj->resetStats(); + } } // @@ -139,9 +146,11 @@ SimObject::resetAllStats() void SimObject::printAllExtraOutput(ostream &os) { - SimObjectList::iterator i; + SimObjectList::iterator i = simObjectList.begin(); + SimObjectList::iterator end = simObjectList.end(); - for (i = simObjectList.begin(); i != simObjectList.end(); ++i) { - (*i)->printExtraOutput(os); + for (; i != end; ++i) { + SimObject *obj = *i; + obj->printExtraOutput(os); } } |