Bug 1591132 - Make the checker's booleans relaxed. r=nika draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 24 Oct 2019 16:42:06 +0000
changeset 2396071 c9282b78fc063915867d61fd09d43c2851f9fd0e
parent 2396070 01599056406018f893caf9bd4aa59661bb3e93bb
child 2396072 9f38bb709430a307cc9641c6d22048b24b73673b
push id439690
push userreviewbot
push dateThu, 24 Oct 2019 16:42:25 +0000
treeherdertry@f953926e99b6 [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.