Fix: Address a few benign memory leaks

This patch is the result of static analysis identifying a number of
memory leaks. The leaks are all benign as they are a result of not
deallocating memory in the desctructor. The fix still has value as it
removes false positives in the static analysis.
This commit is contained in:
Andreas Hansson
2012-07-09 12:35:30 -04:00
parent 92eaac0711
commit ff5718f042
18 changed files with 59 additions and 2 deletions

View File

@@ -460,4 +460,6 @@ MSHR::print(std::ostream &os, int verbosity, const std::string &prefix) const
MSHR::~MSHR()
{
delete[] targets;
delete[] deferredTargets;
}

View File

@@ -98,6 +98,14 @@ FALRU::FALRU(unsigned _blkSize, unsigned _size, unsigned hit_latency)
//assert(check());
}
FALRU::~FALRU()
{
if (numCaches)
delete[] cacheBoundaries;
delete[] blks;
}
void
FALRU::regStats(const string &name)
{

View File

@@ -156,6 +156,7 @@ public:
* @param hit_latency The hit latency of the cache.
*/
FALRU(unsigned blkSize, unsigned size, unsigned hit_latency);
~FALRU();
/**
* Register the stats for this object.

View File

@@ -160,6 +160,7 @@ IIC::~IIC()
delete [] dataStore;
delete [] tagStore;
delete [] sets;
delete [] dataBlks;
}
/* register cache stats */