From 27f915e4d917861cd8686730c49c6e89050635da Mon Sep 17 00:00:00 2001 From: "Daniel R. Carvalho" Date: Wed, 8 Jan 2020 23:14:50 +0100 Subject: [PATCH] mem-garnet: Remove delete of param pointers of SimpleNetwork All over gem5 the params pointers are not deleted within the classes that they were created for. Although this is a potential memory leak as of now, it is probably safer to follow general convention so that it can be fixed at once in the future. Change-Id: If96f04058d51513fa8763610880e5524785ee9cf Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24249 Reviewed-by: Nikos Nikoleris Maintainer: Bobby R. Bruce Tested-by: kokoro --- src/mem/ruby/network/simple/SimpleNetwork.cc | 8 -------- src/mem/ruby/network/simple/SimpleNetwork.hh | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/mem/ruby/network/simple/SimpleNetwork.cc b/src/mem/ruby/network/simple/SimpleNetwork.cc index 56f948f4c..51d4daed4 100644 --- a/src/mem/ruby/network/simple/SimpleNetwork.cc +++ b/src/mem/ruby/network/simple/SimpleNetwork.cc @@ -32,7 +32,6 @@ #include #include "base/cast.hh" -#include "base/stl_helpers.hh" #include "mem/ruby/common/NetDest.hh" #include "mem/ruby/network/MessageBuffer.hh" #include "mem/ruby/network/simple/SimpleLink.hh" @@ -41,7 +40,6 @@ #include "mem/ruby/profiler/Profiler.hh" using namespace std; -using m5::stl_helpers::deletePointers; SimpleNetwork::SimpleNetwork(const Params *p) : Network(p), m_buffer_size(p->buffer_size), @@ -71,12 +69,6 @@ SimpleNetwork::init() m_topology_ptr->createLinks(this); } -SimpleNetwork::~SimpleNetwork() -{ - deletePointers(m_switches); - deletePointers(m_int_link_buffers); -} - // From a switch to an endpoint node void SimpleNetwork::makeExtOutLink(SwitchID src, NodeID dest, BasicLink* link, diff --git a/src/mem/ruby/network/simple/SimpleNetwork.hh b/src/mem/ruby/network/simple/SimpleNetwork.hh index 8b870e735..b2e5080de 100644 --- a/src/mem/ruby/network/simple/SimpleNetwork.hh +++ b/src/mem/ruby/network/simple/SimpleNetwork.hh @@ -45,7 +45,7 @@ class SimpleNetwork : public Network public: typedef SimpleNetworkParams Params; SimpleNetwork(const Params *p); - ~SimpleNetwork(); + ~SimpleNetwork() = default; void init(); -- 2.30.2