summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2009-11-18 13:55:57 -0800
committerBrad Beckmann <Brad.Beckmann@amd.com>2009-11-18 13:55:57 -0800
commitb7cc66af311923610d612463d401447fb814f258 (patch)
tree9919c58d8166d2efbe9f4b9622b13f832edc1e4e /src
parent5492f71755d71ba47f3510e51510b1bbe96b743a (diff)
downloadgem5-b7cc66af311923610d612463d401447fb814f258.tar.xz
ruby: Ruby destruction fix.
Diffstat (limited to 'src')
-rw-r--r--src/mem/ruby/common/DataBlock.hh6
-rw-r--r--src/mem/ruby/common/NetDest.hh2
-rw-r--r--src/mem/ruby/network/simple/SimpleNetwork.cc2
-rw-r--r--src/mem/rubymem.cc7
-rw-r--r--src/mem/rubymem.hh3
5 files changed, 14 insertions, 6 deletions
diff --git a/src/mem/ruby/common/DataBlock.hh b/src/mem/ruby/common/DataBlock.hh
index 3c8ef56f4..1d399753e 100644
--- a/src/mem/ruby/common/DataBlock.hh
+++ b/src/mem/ruby/common/DataBlock.hh
@@ -45,7 +45,11 @@ class DataBlock {
}
// Destructor
- ~DataBlock() { if(m_alloc) delete [] m_data;}
+ ~DataBlock() {
+ if(m_alloc) {
+ delete [] m_data;
+ }
+ }
DataBlock& operator=(const DataBlock& obj);
diff --git a/src/mem/ruby/common/NetDest.hh b/src/mem/ruby/common/NetDest.hh
index 1dcee7b7a..7301409ce 100644
--- a/src/mem/ruby/common/NetDest.hh
+++ b/src/mem/ruby/common/NetDest.hh
@@ -63,7 +63,7 @@ public:
NetDest& operator=(const Set& obj);
// Destructor
- // ~NetDest();
+ ~NetDest() { DEBUG_MSG(MEMORY_COMP, LowPrio, "NetDest Destructor"); }
// Public Methods
void add(MachineID newElement);
diff --git a/src/mem/ruby/network/simple/SimpleNetwork.cc b/src/mem/ruby/network/simple/SimpleNetwork.cc
index 497c602d1..1a45340ed 100644
--- a/src/mem/ruby/network/simple/SimpleNetwork.cc
+++ b/src/mem/ruby/network/simple/SimpleNetwork.cc
@@ -124,7 +124,7 @@ SimpleNetwork::~SimpleNetwork()
}
m_switch_ptr_vector.deletePointers();
m_buffers_to_free.deletePointers();
- delete m_topology_ptr;
+ // delete m_topology_ptr;
}
// From a switch to an endpoint node
diff --git a/src/mem/rubymem.cc b/src/mem/rubymem.cc
index 2fb529e12..14b2048a0 100644
--- a/src/mem/rubymem.cc
+++ b/src/mem/rubymem.cc
@@ -60,7 +60,7 @@ RubyMemory::RubyMemory(const Params *p)
vector<RubyObjConf> sys_conf;
while (!config.eof()) {
- char buffer[4096];
+ char buffer[65536];
config.getline(buffer, sizeof(buffer));
string line = buffer;
if (line.empty())
@@ -119,8 +119,8 @@ RubyMemory::init()
}
//Print stats at exit
- RubyExitCallback* rc = new RubyExitCallback(this);
- registerExitCallback(rc);
+ rubyExitCB = new RubyExitCallback(this);
+ registerExitCallback(rubyExitCB);
//Sched RubyEvent, automatically reschedules to advance ruby cycles
rubyTickEvent = new RubyEvent(this);
@@ -138,6 +138,7 @@ RubyMemory::tick()
RubyMemory::~RubyMemory()
{
+ delete g_system_ptr;
}
void
diff --git a/src/mem/rubymem.hh b/src/mem/rubymem.hh
index e33418a42..1bfb135e8 100644
--- a/src/mem/rubymem.hh
+++ b/src/mem/rubymem.hh
@@ -40,6 +40,8 @@
#include "mem/ruby/system/RubyPort.hh"
#include "params/RubyMemory.hh"
+class RubyExitCallback;
+
class RubyMemory : public PhysicalMemory
{
public:
@@ -119,6 +121,7 @@ class RubyMemory : public PhysicalMemory
private:
Tick ruby_clock;
Tick ruby_phase;
+ RubyExitCallback* rubyExitCB;
public:
static std::map<int64_t, PacketPtr> pending_requests;