summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@gmail.com>2008-03-17 03:08:28 -0400
committerSteve Reinhardt <stever@gmail.com>2008-03-17 03:08:28 -0400
commitb051ae6acc5a4e98ba60478f42ba2a2b92cb5ff1 (patch)
treed15140584d2a77484dd3b63caac1809acd11ddf0
parent131c65f4293c76f2c9b0b98c62b1937cd0aea4ce (diff)
downloadgem5-b051ae6acc5a4e98ba60478f42ba2a2b92cb5ff1.tar.xz
Fix a few Packet memory leaks.
--HG-- extra : convert_revision : 00db19f0698c0786f0dff561eea9217860a5a05a
-rw-r--r--src/mem/cache/cache_impl.hh9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mem/cache/cache_impl.hh b/src/mem/cache/cache_impl.hh
index 5aecea7d5..cf9528a75 100644
--- a/src/mem/cache/cache_impl.hh
+++ b/src/mem/cache/cache_impl.hh
@@ -407,6 +407,9 @@ Cache<TagStore>::timingAccess(PacketPtr pkt)
memSidePort->sendTiming(snoopPkt);
// main memory will delete snoopPkt
}
+ // since we're the official target but we aren't responding,
+ // delete the packet now.
+ delete pkt;
return true;
}
@@ -1092,6 +1095,11 @@ Cache<TagStore>::handleSnoop(PacketPtr pkt, BlkType *blk,
pkt->makeAtomicResponse();
pkt->setDataFromBlock(blk->data, blkSize);
}
+ } else if (is_timing && is_deferred) {
+ // if it's a deferred timing snoop then we've made a copy of
+ // the packet, and so if we're not using that copy to respond
+ // then we need to delete it here.
+ delete pkt;
}
// Do this last in case it deallocates block data or something
@@ -1160,6 +1168,7 @@ Cache<TagStore>::snoopTiming(PacketPtr pkt)
if (pkt->isInvalidate()) {
// Invalidation trumps our writeback... discard here
markInService(mshr);
+ delete wb_pkt;
}
// If this was a shared writeback, there may still be