diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2014-10-16 05:49:46 -0400 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2014-10-16 05:49:46 -0400 |
commit | ad3f75dc81efc8818786c32d6190e3ed069b9fc6 (patch) | |
tree | f3f0e2a55a3fbcd554fb8d4f110e41991de03ae9 /src/dev/etherpkt.hh | |
parent | 4e67ab6663f8f4960a1078546906746877f87e1a (diff) | |
download | gem5-ad3f75dc81efc8818786c32d6190e3ed069b9fc6.tar.xz |
dev: Use shared_ptr for EthPacketData
This patch transitions the EthPacketData 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 bool casting operator for the shared_ptr is explicit, and we must
therefore either cast it, compare it to NULL (p != nullptr), double
negate it (!!p) or do a (p ? true : false).
Diffstat (limited to 'src/dev/etherpkt.hh')
-rw-r--r-- | src/dev/etherpkt.hh | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/dev/etherpkt.hh b/src/dev/etherpkt.hh index c71d9cc30..16576d329 100644 --- a/src/dev/etherpkt.hh +++ b/src/dev/etherpkt.hh @@ -40,14 +40,13 @@ #include <iosfwd> #include <memory> -#include "base/refcnt.hh" #include "base/types.hh" /* * Reference counted class containing ethernet packet data */ class Checkpoint; -class EthPacketData : public RefCounted +class EthPacketData { public: /* @@ -81,6 +80,6 @@ class EthPacketData : public RefCounted const std::string §ion); }; -typedef RefCountingPtr<EthPacketData> EthPacketPtr; +typedef std::shared_ptr<EthPacketData> EthPacketPtr; #endif // __ETHERPKT_HH__ |