diff options
Diffstat (limited to 'src/mem/ruby/system/CacheRecorder.cc')
-rw-r--r-- | src/mem/ruby/system/CacheRecorder.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mem/ruby/system/CacheRecorder.cc b/src/mem/ruby/system/CacheRecorder.cc index 83e8a70dd..1fc7bb8ef 100644 --- a/src/mem/ruby/system/CacheRecorder.cc +++ b/src/mem/ruby/system/CacheRecorder.cc @@ -85,9 +85,9 @@ CacheRecorder::enqueueNextFlushRequest() if (m_records_flushed < m_records.size()) { TraceRecord* rec = m_records[m_records_flushed]; m_records_flushed++; - Request* req = new Request(rec->m_data_address, - m_block_size_bytes, 0, - Request::funcMasterId); + auto req = std::make_shared<Request>(rec->m_data_address, + m_block_size_bytes, 0, + Request::funcMasterId); MemCmd::Command requestType = MemCmd::FlushReq; Packet *pkt = new Packet(req, requestType); @@ -112,21 +112,24 @@ CacheRecorder::enqueueNextFetchRequest() for (int rec_bytes_read = 0; rec_bytes_read < m_block_size_bytes; rec_bytes_read += RubySystem::getBlockSizeBytes()) { - Request* req = nullptr; + RequestPtr req; MemCmd::Command requestType; if (traceRecord->m_type == RubyRequestType_LD) { requestType = MemCmd::ReadReq; - req = new Request(traceRecord->m_data_address + rec_bytes_read, + req = std::make_shared<Request>( + traceRecord->m_data_address + rec_bytes_read, RubySystem::getBlockSizeBytes(), 0, Request::funcMasterId); } else if (traceRecord->m_type == RubyRequestType_IFETCH) { requestType = MemCmd::ReadReq; - req = new Request(traceRecord->m_data_address + rec_bytes_read, + req = std::make_shared<Request>( + traceRecord->m_data_address + rec_bytes_read, RubySystem::getBlockSizeBytes(), Request::INST_FETCH, Request::funcMasterId); } else { requestType = MemCmd::WriteReq; - req = new Request(traceRecord->m_data_address + rec_bytes_read, + req = std::make_shared<Request>( + traceRecord->m_data_address + rec_bytes_read, RubySystem::getBlockSizeBytes(), 0, Request::funcMasterId); } |