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 666358 0b53a48b1f865511a0363ae896396719078dc718
parent 666274 ffe6cc09ccf38cca6f0e727837bbc6cb722d1e71
child 666359 6db139aa76584cdf2810f7860783321898cbec87
push id80381
push userbmo:continuation@gmail.com
push dateMon, 18 Sep 2017 17:12:47 +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)