Revert "Use constexpr initializers for AtomicHashArray Config"
authorBrett Simmers <bsimmers@fb.com>
Sat, 1 Aug 2015 20:39:19 +0000 (13:39 -0700)
committerfacebook-github-bot-1 <folly-bot@fb.com>
Sat, 1 Aug 2015 21:22:07 +0000 (14:22 -0700)
Summary: D2284130 broke the HHVM clang build.

Reviewed By: @mxw

Differential Revision: D2303914

folly/AtomicHashArray.h
folly/AtomicLinkedList.h

index be78769563deac4c2dc130eeeed0da5265597399..7f12f862ca1af68e0fc5d5b0de24af5ad6e0886b 100644 (file)
@@ -128,15 +128,9 @@ class AtomicHashArray : boost::noncopyable {
     int    entryCountThreadCacheSize;
     size_t capacity; // if positive, overrides maxLoadFactor
 
-  private:
-    static constexpr KeyT kEmptyKey = (KeyT)-1;
-    static constexpr KeyT kLockedKey = (KeyT)-2;
-    static constexpr KeyT kErasedKey = (KeyT)-3;
-
-  public:
-    constexpr Config() : emptyKey(kEmptyKey),
-                         lockedKey(kLockedKey),
-                         erasedKey(kErasedKey),
+    constexpr Config() : emptyKey((KeyT)-1),
+                         lockedKey((KeyT)-2),
+                         erasedKey((KeyT)-3),
                          maxLoadFactor(0.8),
                          growthFactor(-1),
                          entryCountThreadCacheSize(1000),
index f24746a5d1f6f8e0f7c234f75f5dfd2d1a99853a..eca8de16d9b32450cdab81876ae1c3834c6c9efe 100644 (file)
@@ -63,7 +63,7 @@ class AtomicLinkedList {
    * Note: list must be empty on destruction.
    */
   ~AtomicLinkedList() {
-    assert(empty());
+    assert(head_ == nullptr);
   }
 
   bool empty() const {