Bug 1277260, part 1 - Make PtrInfo into a class and mark it final. r=smaug draft
authorAndrew McCreight <continuation@gmail.com>
Fri, 15 Sep 2017 12:35:18 -0700
changeset 665659 6d6a195e4b721b557a52f06668058cd224308932
parent 665543 9071a20f3eaa804a439990b7596dbc16d52d1e20
child 665660 6a7daf1c4d07a5985e7f90f97243c5d039cd7018
push id80133
push userbmo:continuation@gmail.com
push dateFri, 15 Sep 2017 20:21:50 +0000
reviewerssmaug
bugs1277260
milestone57.0a1
Bug 1277260, part 1 - Make PtrInfo into a class and mark it final. r=smaug MozReview-Commit-ID: 3UJ89eCkBsd
xpcom/base/nsCycleCollector.cpp
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -369,17 +369,17 @@ public:
 };
 #endif
 
 
 ////////////////////////////////////////////////////////////////////////
 // Base types
 ////////////////////////////////////////////////////////////////////////
 
-struct PtrInfo;
+class PtrInfo;
 
 class EdgePool
 {
 public:
   // EdgePool allocates arrays of void*, primarily to hold PtrInfo*.
   // However, at the end of a block, the last two pointers are a null
   // and then a void** pointing to the next block.  This allows
   // EdgePool::Iterators to be a single word but still capable of crossing
@@ -574,23 +574,25 @@ public:
     } while(0)
 
 enum NodeColor { black, white, grey };
 
 // This structure should be kept as small as possible; we may expect
 // hundreds of thousands of them to be allocated and touched
 // repeatedly during each cycle collection.
 
-struct PtrInfo
+class PtrInfo final
 {
+public:
   void* mPointer;
   nsCycleCollectionParticipant* mParticipant;
   uint32_t mColor : 2;
   uint32_t mInternalRefs : 30;
   uint32_t mRefCount;
+
 private:
   EdgePool::Iterator mFirstChild;
 
   static const uint32_t kInitialRefCount = UINT32_MAX - 1;
 
 public:
 
   PtrInfo(void* aPointer, nsCycleCollectionParticipant* aParticipant)