summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system/DirectoryMemory.cc
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2009-11-18 13:55:58 -0800
committerBrad Beckmann <Brad.Beckmann@amd.com>2009-11-18 13:55:58 -0800
commit204d1776caa17329b84e5ebbe50fca4f1e80c100 (patch)
tree5dd59a5c0290fb6ef416127febcaad7dc6e207cc /src/mem/ruby/system/DirectoryMemory.cc
parentb8c413e99325faf54182e34413ece8ed0e4e0592 (diff)
downloadgem5-204d1776caa17329b84e5ebbe50fca4f1e80c100.tar.xz
ruby: Fixed Directory memory destructor
Diffstat (limited to 'src/mem/ruby/system/DirectoryMemory.cc')
-rw-r--r--src/mem/ruby/system/DirectoryMemory.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mem/ruby/system/DirectoryMemory.cc b/src/mem/ruby/system/DirectoryMemory.cc
index c87be94a2..e230059ad 100644
--- a/src/mem/ruby/system/DirectoryMemory.cc
+++ b/src/mem/ruby/system/DirectoryMemory.cc
@@ -84,11 +84,14 @@ void DirectoryMemory::init(const vector<string> & argv)
DirectoryMemory::~DirectoryMemory()
{
// free up all the directory entries
- for (int i=0;i<m_num_entries;i++)
- if (m_entries[i] != NULL)
- delete m_entries;
- if (m_entries != NULL)
+ for (uint64 i=0;i<m_num_entries;i++) {
+ if (m_entries[i] != NULL) {
+ delete m_entries[i];
+ }
+ }
+ if (m_entries != NULL) {
delete [] m_entries;
+ }
}
void DirectoryMemory::printConfig(ostream& out) const