mem-garnet: Remove delete of param pointers of SimpleNetwork
authorDaniel R. Carvalho <odanrc@yahoo.com.br>
Wed, 8 Jan 2020 22:14:50 +0000 (23:14 +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: If96f04058d51513fa8763610880e5524785ee9cf
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24249
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/simple/SimpleNetwork.cc
src/mem/ruby/network/simple/SimpleNetwork.hh

index 56f948f4c2451bca1834f7ad6b64f009511ed302..51d4daed400623df5d795b50c7d986ef75a93844 100644 (file)
@@ -32,7 +32,6 @@
 #include <numeric>
 
 #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,
index 8b870e735861f38fb28fcb35bfe8d25d0744ca8f..b2e5080de59d8b4baf89356491c97609a6ac0761 100644 (file)
@@ -45,7 +45,7 @@ class SimpleNetwork : public Network
   public:
     typedef SimpleNetworkParams Params;
     SimpleNetwork(const Params *p);
-    ~SimpleNetwork();
+    ~SimpleNetwork() = default;
 
     void init();