From db3739682d7c54839b627ff8f7a4448a9dc99987 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Thu, 16 Oct 2014 05:49:49 -0400 Subject: 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. --- src/mem/ruby/slicc_interface/Message.hh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mem/ruby/slicc_interface/Message.hh') diff --git a/src/mem/ruby/slicc_interface/Message.hh b/src/mem/ruby/slicc_interface/Message.hh index 1c842ae69..786c656bc 100644 --- a/src/mem/ruby/slicc_interface/Message.hh +++ b/src/mem/ruby/slicc_interface/Message.hh @@ -30,14 +30,14 @@ #define __MEM_RUBY_SLICC_INTERFACE_MESSAGE_HH__ #include +#include -#include "base/refcnt.hh" #include "mem/packet.hh" class Message; -typedef RefCountingPtr MsgPtr; +typedef std::shared_ptr MsgPtr; -class Message : public RefCounted +class Message { public: Message(Tick curTime) @@ -54,7 +54,7 @@ class Message : public RefCounted virtual ~Message() { } - virtual Message* clone() const = 0; + virtual MsgPtr clone() const = 0; virtual void print(std::ostream& out) const = 0; virtual void setIncomingLink(int) {} virtual void setVnet(int) {} -- cgit v1.2.3