Andreas Hansson got review request #2442!
dev: Use shared_ptr for EthPacketData
Review Request #2442 - Created Sept. 29, 2014 and submitted
| Information | |
|---|---|
| Andreas Hansson | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 10450:076698950779 --------------------------- 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).
Posted (Oct. 1, 2014, 4:37 p.m.)
Are the bool cast operators being used anywhere? It looks like you put them in, but then do the 'ptr != nullptr' thing everywhere we need a bool, so I'm wondering if they're useful.
How about replacing the cast operator with 'bool isNull() const { return p == nullptr; }', then all of the checks can just be 'ptr.isNull()'?
Review request changed
Updated (Oct. 8, 2014, 12:41 a.m.)
Description: |
|
|||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+26 -24) |
