mem: Fix missing delete of packet in DRAM access
authorAndreas Hansson <andreas.hansson@arm.com>
Mon, 18 Mar 2013 09:22:45 +0000 (05:22 -0400)
committerAndreas Hansson <andreas.hansson@arm.com>
Mon, 18 Mar 2013 09:22:45 +0000 (05:22 -0400)
This patch fixes a memory leak caused by not deleting packets that
require no response.

src/mem/simple_dram.cc

index 90517ec629142125326eaea8571f040e640b33eb..0b24b4056874c17585d571af7a088ca62f4ea834 100644 (file)
@@ -739,6 +739,9 @@ SimpleDRAM::accessAndRespond(PacketPtr pkt)
         // next tick
         port.schedTimingResp(pkt, curTick() + 1);
     } else {
+        // @todo the packet is going to be deleted, and the DRAMPacket
+        // is still having a pointer to it
+        pendingDelete.push_back(pkt);
     }
 
     DPRINTF(DRAM, "Done\n");