Ruby System, Cache Recorder: Use delete [] for trace vars

The cache trace variables are array allocated uint8_t* in the RubySystem and
the Ruby CacheRecorder, but the code used delete to free the memory, resulting
in Valgrind memory errors. Change these deletes to delete [] to get rid of the
errors.
This commit is contained in:
Joel Hestness 2013-04-07 20:31:15 -05:00
parent 7fb55b98cc
commit 3b02210713
2 changed files with 2 additions and 2 deletions

View file

@ -61,7 +61,7 @@ CacheRecorder::CacheRecorder(uint8_t* uncompressed_trace,
CacheRecorder::~CacheRecorder()
{
if (m_uncompressed_trace != NULL) {
delete m_uncompressed_trace;
delete [] m_uncompressed_trace;
m_uncompressed_trace = NULL;
}
m_seq_map.clear();

View file

@ -331,7 +331,7 @@ RubySystem::unserialize(Checkpoint *cp, const string &section)
memory_trace_size);
m_mem_vec_ptr->populatePages(uncompressed_trace);
delete uncompressed_trace;
delete [] uncompressed_trace;
uncompressed_trace = NULL;
}