From ad3f75dc81efc8818786c32d6190e3ed069b9fc6 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Thu, 16 Oct 2014 05:49:46 -0400 Subject: 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). --- src/dev/pktfifo.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dev/pktfifo.cc') diff --git a/src/dev/pktfifo.cc b/src/dev/pktfifo.cc index e5d67d5ec..efd8b083d 100644 --- a/src/dev/pktfifo.cc +++ b/src/dev/pktfifo.cc @@ -77,7 +77,7 @@ void PacketFifoEntry::unserialize(const string &base, Checkpoint *cp, const string §ion) { - packet = new EthPacketData(16384); + packet = make_shared(16384); packet->unserialize(base + ".packet", cp, section); paramIn(cp, section, base + ".slack", slack); paramIn(cp, section, base + ".number", number); -- cgit v1.2.3