From: Daniel R. Carvalho Date: Wed, 8 Jan 2020 22:14:50 +0000 (+0100) Subject: mem-garnet: Remove delete of param pointers of SimpleNetwork X-Git-Tag: v20.0.0.0~331 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=27f915e4d917861cd8686730c49c6e89050635da;p=gem5.git 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 --- 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();