Shrink MicroSpinLock.h transitive includes and inline methods
authorYedidya Feldblum <yfeldblum@fb.com>
Wed, 30 Aug 2017 03:28:59 +0000 (20:28 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 30 Aug 2017 03:34:23 +0000 (20:34 -0700)
Summary: [Folly] Shrink `MicroSpinLock.h` transitive includes and inline methods.

Reviewed By: meyering

Differential Revision: D5732693

fbshipit-source-id: 386816f0d97c145ff8a4180d41c8a682694aa6cb

folly/MicroSpinLock.h
folly/detail/Sleeper.h

index ee2c4420f62a33953d68d94885708ece6cddfe0b..d0c9ac23a19562c69aabd54d4757a56a2684549b 100644 (file)
 
 #include <array>
 #include <atomic>
-#include <cinttypes>
-#include <cstdlib>
+#include <cassert>
+#include <cstdint>
 #include <mutex>
 #include <type_traits>
 
-#include <boost/noncopyable.hpp>
-#include <glog/logging.h>
-
 #include <folly/Portability.h>
 #include <folly/detail/Sleeper.h>
 
@@ -86,11 +83,11 @@ struct MicroSpinLock {
         sleeper.wait();
       }
     } while (!try_lock());
-    DCHECK(payload()->load() == LOCKED);
+    assert(payload()->load() == LOCKED);
   }
 
   void unlock() {
-    CHECK(payload()->load() == LOCKED);
+    assert(payload()->load() == LOCKED);
     payload()->store(FREE, std::memory_order_release);
   }
 
index c2efad002098bbf1e018edd5f83e1f094a538af7..2d1f24874b27ef33e1fd6171226a48b8e8dfba15 100644 (file)
@@ -21,7 +21,7 @@
  * @author Jordan DeLong <delong.j@fb.com>
  */
 
-#include <cinttypes>
+#include <cstdint>
 
 #include <folly/portability/Asm.h>
 #include <folly/portability/Time.h>