summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2010-04-02 11:20:32 -0700
committerNathan Binkert <nate@binkert.org>2010-04-02 11:20:32 -0700
commit01dffaa32fb68981e7d8ff1a0beb96de7b892546 (patch)
tree1f1d2a2ad855e5badeabfac351c142f8134a0fba
parent141f61d83a23096dcff20df704bdd734c520f535 (diff)
downloadgem5-01dffaa32fb68981e7d8ff1a0beb96de7b892546.tar.xz
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.
-rw-r--r--src/base/refcnt.hh4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/base/refcnt.hh b/src/base/refcnt.hh
index d1663ad72..64224ca7f 100644
--- a/src/base/refcnt.hh
+++ b/src/base/refcnt.hh
@@ -37,7 +37,11 @@ class RefCounted
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) {}