summaryrefslogtreecommitdiff
path: root/src/mem/simple_mem.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2015-11-06 03:26:21 -0500
committerAndreas Hansson <andreas.hansson@arm.com>2015-11-06 03:26:21 -0500
commitac1368df50af123b32b41d7115ea4a0f15f7c97f (patch)
tree107ba41258ee0a30de841624bc6f3c5fab041d8f /src/mem/simple_mem.cc
parent2cb5467e8514934c4d88304c65050adead0ffc7e (diff)
downloadgem5-ac1368df50af123b32b41d7115ea4a0f15f7c97f.tar.xz
mem: Unify delayed packet deletion
This patch unifies how we deal with delayed packet deletion, where the receiving slave is responsible for deleting the packet, but the sending agent (e.g. a cache) is still relying on the pointer until the call to sendTimingReq completes. Previously we used a mix of a deletion vector and a construct using unique_ptr. With this patch we ensure all slaves use the latter approach.
Diffstat (limited to 'src/mem/simple_mem.cc')
-rw-r--r--src/mem/simple_mem.cc10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/mem/simple_mem.cc b/src/mem/simple_mem.cc
index f68066e75..7e350feb6 100644
--- a/src/mem/simple_mem.cc
+++ b/src/mem/simple_mem.cc
@@ -97,16 +97,10 @@ SimpleMemory::recvFunctional(PacketPtr pkt)
bool
SimpleMemory::recvTimingReq(PacketPtr pkt)
{
- /// @todo temporary hack to deal with memory corruption issues until
- /// 4-phase transactions are complete
- for (int x = 0; x < pendingDelete.size(); x++)
- delete pendingDelete[x];
- pendingDelete.clear();
-
if (pkt->memInhibitAsserted()) {
// snooper will supply based on copy of packet
// still target's responsibility to delete packet
- pendingDelete.push_back(pkt);
+ pendingDelete.reset(pkt);
return true;
}
@@ -165,7 +159,7 @@ SimpleMemory::recvTimingReq(PacketPtr pkt)
if (!retryResp && !dequeueEvent.scheduled())
schedule(dequeueEvent, packetQueue.back().tick);
} else {
- pendingDelete.push_back(pkt);
+ pendingDelete.reset(pkt);
}
return true;