Backout changeset bc2bbe9836c7 (bug 834769) for bustage.
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 29 Jan 2013 09:49:16 +0100
changeset 130052 954fc89373b8e19044d9da472b2d2b11af8cef9d
parent 130051 306003528e10cfa41efcda226671caec38e7e988
child 130053 8e1f8a3c55acf29f3cfba1719b8b3ae601cd503c
push idunknown
push userunknown
push dateunknown
bugs834769
milestone21.0a1
backs outbc2bbe9836c7c40eedca35e79d4f73974736e20d
Backout changeset bc2bbe9836c7 (bug 834769) for bustage.
mfbt/RefPtr.h
--- a/mfbt/RefPtr.h
+++ b/mfbt/RefPtr.h
@@ -31,41 +31,40 @@ template<typename T> OutParamRef<T> byRe
  * refcount > 0.  It's an error to allocate and free a bare
  * RefCounted<T>, i.e. outside of the RefPtr machinery.  Attempts to
  * do so will abort DEBUG builds.
  *
  * Live RefCounted<T> have refcount > 0.  The lifetime (refcounts) of
  * live RefCounted<T> are controlled by RefPtr<T> and
  * RefPtr<super/subclass of T>.  Upon a transition from refcounted==1
  * to 0, the RefCounted<T> "dies" and is destroyed.  The "destroyed"
- * state is represented in DEBUG builds by refcount==0xffffdead.  This
+ * state is represented in DEBUG builds by refcount==-0xdead.  This
  * state distinguishes use-before-ref (refcount==0) from
- * use-after-destroy (refcount==0xffffdead).
+ * use-after-destroy (refcount==-0xdead).
  */
 template<typename T>
 class RefCounted
 {
     friend class RefPtr<T>;
 
-  protected:
+  public:
     RefCounted() : refCnt(0) { }
-    ~RefCounted() { MOZ_ASSERT(refCnt == 0xffffdead); }
+    ~RefCounted() { MOZ_ASSERT(refCnt == -0xdead); }
 
-  public:
     // Compatibility with nsRefPtr.
     void AddRef() {
       MOZ_ASSERT(refCnt >= 0);
       ++refCnt;
     }
 
     void Release() {
       MOZ_ASSERT(refCnt > 0);
       if (0 == --refCnt) {
 #ifdef DEBUG
-        refCnt = 0xffffdead;
+        refCnt = -0xdead;
 #endif
         delete static_cast<T*>(this);
       }
     }
 
     // Compatibility with wtf::RefPtr.
     void ref() { AddRef(); }
     void deref() { Release(); }