> On Oct. 1, 2014, 11:37 p.m., Steve Reinhardt wrote:
> > 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()'?
There are some 50+ occurrences where the bool operator is used. I'd prefer to
leave it as it if that's ok.
- Andreas
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviews.gem5.org/r/2442/#review5400
-----------------------------------------------------------
On Sept. 29, 2014, 10:39 a.m., Andreas Hansson wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviews.gem5.org/r/2442/
> -----------------------------------------------------------
>
> (Updated Sept. 29, 2014, 10:39 a.m.)
>
>
> Review request for Default.
>
>
> Repository: gem5
>
>
> Description
> -------
>
> Changeset 10438:290510e58445
> ---------------------------
> 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).
>
>
> Diffs
> -----
>
> src/base/inet.hh 28b31101d9e6
> src/dev/etherlink.cc 28b31101d9e6
> src/dev/etherpkt.hh 28b31101d9e6
> src/dev/ethertap.cc 28b31101d9e6
> src/dev/i8254xGBe.cc 28b31101d9e6
> src/dev/ns_gige.cc 28b31101d9e6
> src/dev/pktfifo.cc 28b31101d9e6
> src/dev/sinic.cc 28b31101d9e6
>
> Diff: http://reviews.gem5.org/r/2442/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Andreas Hansson
>
>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev