changeset ca72ee5978ce in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=ca72ee5978ce
description:
refcnt: no default copy contructor or copy operator
We shouldn't allow these because the default versions will copy
the reference count which is definitely not what we want.
diffstat:
1 file changed, 4 insertions(+)
src/base/refcnt.hh | 4 ++++
diffs (15 lines):
diff -r b66b558578bd -r ca72ee5978ce src/base/refcnt.hh
--- a/src/base/refcnt.hh Fri Apr 02 11:20:32 2010 -0700
+++ b/src/base/refcnt.hh Fri Apr 02 11:20:32 2010 -0700
@@ -37,7 +37,11 @@
int count;
private:
+ // Don't allow a default copy constructor or copy operator on
+ // these objects because the default operation will copy the
+ // reference count as well and we certainly don't want that.
RefCounted(const RefCounted &);
+ RefCounted &operator=(const RefCounted &);
public:
RefCounted() : count(0) {}
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev