changeset 3a790012d6ed in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=3a790012d6ed
description:
        RefCount: Fix reference counting pointer == and != with a T* on the 
left.

        These operators were expecting a const T& instead of a const T*, and 
were not
        being picked up and used by gcc in the right places as a result. 
Apparently no
        one used these operators before. A unit test which exposed these 
problems,
        verified the solution, and checks other basic functionality is on the 
way.

diffstat:

 src/base/refcnt.hh |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 9d94b886c61b -r 3a790012d6ed src/base/refcnt.hh
--- a/src/base/refcnt.hh        Mon Jan 03 12:40:31 2011 -0600
+++ b/src/base/refcnt.hh        Mon Jan 03 15:31:20 2011 -0500
@@ -109,7 +109,7 @@
 { return l.get() == r; }
 
 template<class T>
-bool operator==(const T &l, const RefCountingPtr<T> &r)
+bool operator==(const T *l, const RefCountingPtr<T> &r)
 { return l == r.get(); }
 
 template<class T>
@@ -121,7 +121,7 @@
 { return l.get() != r; }
 
 template<class T>
-bool operator!=(const T &l, const RefCountingPtr<T> &r)
+bool operator!=(const T *l, const RefCountingPtr<T> &r)
 { return l != r.get(); }
 
 #endif // __BASE_REFCNT_HH__
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to