From 520442b01afb3742a6dde552b8d62351d2200aba Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Sat, 20 Dec 2003 16:25:48 -0500 Subject: Fix a bunch of memory leak type bugs, and add some better checking in places to make sure stuff is behaving properly. base/statistics.cc: separate the per stat check from the general stats check. We always want the general stuff to happen base/statistics.hh: - separate the per stat check from the general stats check. we always want the general stuff to happen - make every stat check that its bin is at least initialized - set the vector2d x and y coordinates in init to prevent an uninitialized memory access test/Makefile: don't need sim_time.o to test stats test/stattest.cc: don't make x and y the same on the 2d test so that we make sure that the two dimensions are correct --HG-- extra : convert_revision : 81320325056ac1c09f6842474fb6ee3bcc030a8e --- test/Makefile | 2 +- test/stattest.cc | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/Makefile b/test/Makefile index 29d252df4..ceb3c9a1c 100644 --- a/test/Makefile +++ b/test/Makefile @@ -52,7 +52,7 @@ offtest: offtest.o rangetest: rangetest.o str.o $(CXX) $(LFLAGS) -o $@ $^ -stattest: cprintf.o hostinfo.o misc.o sim_time.o statistics.o stattest.o str.o +stattest: cprintf.o hostinfo.o misc.o statistics.o stattest.o str.o $(CXX) $(LFLAGS) -o $@ $^ strnumtest: strnumtest.o str.o diff --git a/test/stattest.cc b/test/stattest.cc index dea5295cc..7c171be80 100644 --- a/test/stattest.cc +++ b/test/stattest.cc @@ -115,7 +115,7 @@ main(int argc, char *argv[]) s13.init(4, 0, 99, 10); s14.init(9); s15.init(10); - s16.init(2, 2); + s16.init(2, 9); s1 .name("Stat01") @@ -271,6 +271,11 @@ main(int argc, char *argv[]) s16[0][0] = 2; s16[1][1] = 9; s16[1][1] += 9; + s16[1][8] += 8; + s16[1][7] += 7; + s16[1][6] += 6; + s16[1][5] += 5; + s16[1][4] += 4; s11 = 1; s3 = 9; -- cgit v1.2.3