mem-garnet: Remove delete of param pointers of GarnetNetwork
authorDaniel R. Carvalho <odanrc@yahoo.com.br>
Wed, 8 Jan 2020 21:35:28 +0000 (22:35 +0100)
committerDaniel Carvalho <odanrc@yahoo.com.br>
Mon, 16 Mar 2020 22:23:16 +0000 (22:23 +0000)
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 <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24246
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
src/mem/ruby/network/garnet2.0/GarnetNetwork.cc
src/mem/ruby/network/garnet2.0/GarnetNetwork.hh

index b4aef13fd72eb7fc88b7fedf8d78d7eff005081b..1eff92175945ce4e6b4eb39d7e4da7928b364cac 100644 (file)
@@ -33,7 +33,6 @@
 #include <cassert>
 
 #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.
index 68658db45a41188239a43ba4b0a4d4623e58a7de..9acbeef4e3f36b1a64443860f7425df53e5040e9 100644 (file)
@@ -51,8 +51,8 @@ class GarnetNetwork : public Network
   public:
     typedef GarnetNetworkParams Params;
     GarnetNetwork(const Params *p);
+    ~GarnetNetwork() = default;
 
-    ~GarnetNetwork();
     void init();
 
     // Configuration (set externally)