summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system/DMASequencer.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2014-10-16 05:49:49 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2014-10-16 05:49:49 -0400
commitdb3739682d7c54839b627ff8f7a4448a9dc99987 (patch)
treeef5e44342d585e102e2dd4b5503b0111bb8ce35f /src/mem/ruby/system/DMASequencer.cc
parentacdfcad30de8dcf59515b688a1310ba2c1ca6947 (diff)
downloadgem5-db3739682d7c54839b627ff8f7a4448a9dc99987.tar.xz
mem: Use shared_ptr for Ruby Message classes
This patch transitions the Ruby Message and its derived classes from the ad-hoc RefCountingPtr to the c++11 shared_ptr. There are no changes in behaviour, and the code modifications are mainly replacing "new" with "make_shared". The cloning of derived messages is slightly changed as they previously relied on overriding the base-class through covariant return types.
Diffstat (limited to 'src/mem/ruby/system/DMASequencer.cc')
-rw-r--r--src/mem/ruby/system/DMASequencer.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mem/ruby/system/DMASequencer.cc b/src/mem/ruby/system/DMASequencer.cc
index 9b0157b45..2a458a408 100644
--- a/src/mem/ruby/system/DMASequencer.cc
+++ b/src/mem/ruby/system/DMASequencer.cc
@@ -26,6 +26,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <memory>
+
#include "debug/RubyDma.hh"
#include "debug/RubyStats.hh"
#include "mem/protocol/SequencerMsg.hh"
@@ -69,7 +71,8 @@ DMASequencer::makeRequest(PacketPtr pkt)
active_request.bytes_issued = 0;
active_request.pkt = pkt;
- SequencerMsg *msg = new SequencerMsg(clockEdge());
+ std::shared_ptr<SequencerMsg> msg =
+ std::make_shared<SequencerMsg>(clockEdge());
msg->getPhysicalAddress() = Address(paddr);
msg->getLineAddress() = line_address(msg->getPhysicalAddress());
msg->getType() = write ? SequencerRequestType_ST : SequencerRequestType_LD;
@@ -107,7 +110,8 @@ DMASequencer::issueNext()
return;
}
- SequencerMsg *msg = new SequencerMsg(clockEdge());
+ std::shared_ptr<SequencerMsg> msg =
+ std::make_shared<SequencerMsg>(clockEdge());
msg->getPhysicalAddress() = Address(active_request.start_paddr +
active_request.bytes_completed);