From: Daniel R. Carvalho Date: Wed, 8 Jan 2020 21:35:28 +0000 (+0100) Subject: mem-garnet: Remove delete of param pointers of GarnetNetwork X-Git-Tag: v20.0.0.0~332 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e23ce9bc73876dec2942c5a3723d324caa42b983;p=gem5.git mem-garnet: Remove delete of param pointers of GarnetNetwork 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: I74b662a8e635cdfb4dc1eae732dd114659fab2e9 Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24246 Reviewed-by: Nikos Nikoleris Maintainer: Bobby R. Bruce Tested-by: kokoro --- diff --git a/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc b/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc index b4aef13fd..1eff92175 100644 --- a/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc +++ b/src/mem/ruby/network/garnet2.0/GarnetNetwork.cc @@ -33,7 +33,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/garnet2.0/CommonTypes.hh" @@ -45,7 +44,6 @@ #include "mem/ruby/system/RubySystem.hh" using namespace std; -using m5::stl_helpers::deletePointers; /* * GarnetNetwork sets up the routers and links and collects stats. @@ -140,14 +138,6 @@ GarnetNetwork::init() } } -GarnetNetwork::~GarnetNetwork() -{ - deletePointers(m_routers); - deletePointers(m_nis); - deletePointers(m_networklinks); - deletePointers(m_creditlinks); -} - /* * This function creates a link from the Network Interface (NI) * into the Network. diff --git a/src/mem/ruby/network/garnet2.0/GarnetNetwork.hh b/src/mem/ruby/network/garnet2.0/GarnetNetwork.hh index 68658db45..9acbeef4e 100644 --- a/src/mem/ruby/network/garnet2.0/GarnetNetwork.hh +++ b/src/mem/ruby/network/garnet2.0/GarnetNetwork.hh @@ -51,8 +51,8 @@ class GarnetNetwork : public Network public: typedef GarnetNetworkParams Params; GarnetNetwork(const Params *p); + ~GarnetNetwork() = default; - ~GarnetNetwork(); void init(); // Configuration (set externally)