diff options
Diffstat (limited to 'src/cpu/testers/memtest/memtest.cc')
-rw-r--r-- | src/cpu/testers/memtest/memtest.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/cpu/testers/memtest/memtest.cc b/src/cpu/testers/memtest/memtest.cc index 89b4d1159..09e7e88a1 100644 --- a/src/cpu/testers/memtest/memtest.cc +++ b/src/cpu/testers/memtest/memtest.cc @@ -136,7 +136,7 @@ MemTest::getMasterPort(const std::string &if_name, PortID idx) void MemTest::completeRequest(PacketPtr pkt, bool functional) { - RequestPtr req = pkt->req; + const RequestPtr &req = pkt->req; assert(req->getSize() == 1); // this address is no longer outstanding @@ -187,8 +187,6 @@ MemTest::completeRequest(PacketPtr pkt, bool functional) } } - delete pkt->req; - // the packet will delete the data delete pkt; @@ -246,7 +244,7 @@ MemTest::tick() bool do_functional = (random_mt.random(0, 100) < percentFunctional) && !uncacheable; - RequestPtr req = new Request(paddr, 1, flags, masterId); + RequestPtr req = std::make_shared<Request>(paddr, 1, flags, masterId); req->setContext(id); outstandingAddrs.insert(paddr); |