Bug 1591132 - Make the checker's booleans relaxed. r=nika draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 24 Oct 2019 16:40:08 +0000
changeset 2396063 d8fa2039f0248015bde9e0ddf3c4884d6631c601
parent 2396062 34fcd66c720a92677037d18cdbb9f569f55539e3
child 2396064 51f04c499b127aae4761ea0f9a4e1e89ea439e3a
push id439688
push userreviewbot
push dateThu, 24 Oct 2019 16:40:25 +0000
treeherdertry@51f04c499b12 [default view] [failures only]
reviewersnika
bugs1591132
milestone72.0a1
Bug 1591132 - Make the checker's booleans relaxed. r=nika I'm pretty sure they can be relaxed, as they don't guard any other memory, and this should reduce their cost. Also remove useless mutable keywords while at it. The checker is marked as mutable itself. Differential Diff: PHID-DIFF-il2x5zxqybdzkgwkgan4
xpcom/ds/PLDHashTable.h
--- a/xpcom/ds/PLDHashTable.h
+++ b/xpcom/ds/PLDHashTable.h
@@ -185,21 +185,21 @@ class Checker {
   // - kIdle and kRead1 are deliberately chosen so that incrementing the -
   //   former gives the latter.
   // - 9999 concurrent readers should be enough for anybody.
   static const uint32_t kIdle = 0;
   static const uint32_t kRead1 = 1;
   static const uint32_t kReadMax = 9999;
   static const uint32_t kWrite = 10000;
 
-  mutable mozilla::Atomic<uint32_t, mozilla::SequentiallyConsistent,
-                          mozilla::recordreplay::Behavior::DontPreserve>
+  mozilla::Atomic<uint32_t, mozilla::Relaxed,
+                  mozilla::recordreplay::Behavior::DontPreserve>
       mState;
-  mutable mozilla::Atomic<uint32_t, mozilla::SequentiallyConsistent,
-                          mozilla::recordreplay::Behavior::DontPreserve>
+  mozilla::Atomic<uint32_t, mozilla::Relaxed,
+                  mozilla::recordreplay::Behavior::DontPreserve>
       mIsWritable;
 };
 #endif
 
 // A PLDHashTable may be allocated on the stack or within another structure or
 // class. No entry storage is allocated until the first element is added. This
 // means that empty hash tables are cheap, which is good because they are
 // common.