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:
2
src/mem/cache/mshr.cc
vendored
2
src/mem/cache/mshr.cc
vendored
@@ -460,4 +460,6 @@ MSHR::print(std::ostream &os, int verbosity, const std::string &prefix) const
|
||||
|
||||
MSHR::~MSHR()
|
||||
{
|
||||
delete[] targets;
|
||||
delete[] deferredTargets;
|
||||
}
|
||||
|
||||
8
src/mem/cache/tags/fa_lru.cc
vendored
8
src/mem/cache/tags/fa_lru.cc
vendored
@@ -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)
|
||||
{
|
||||
|
||||
1
src/mem/cache/tags/fa_lru.hh
vendored
1
src/mem/cache/tags/fa_lru.hh
vendored
@@ -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.
|
||||
|
||||
1
src/mem/cache/tags/iic.cc
vendored
1
src/mem/cache/tags/iic.cc
vendored
@@ -160,6 +160,7 @@ IIC::~IIC()
|
||||
delete [] dataStore;
|
||||
delete [] tagStore;
|
||||
delete [] sets;
|
||||
delete [] dataBlks;
|
||||
}
|
||||
|
||||
/* register cache stats */
|
||||
|
||||
Reference in New Issue
Block a user