Include the fcntl.h portability header where it's needed
[folly.git] / folly / test / MemoryIdlerTest.cpp
index c94bb43b99fa5881d5b1d8e0229e0936ef19cbb5..bcf3fd6ccdd4f0d8fd2b343464f94ecc67ecba08 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 #include <folly/detail/MemoryIdler.h>
+
 #include <folly/Baton.h>
+#include <folly/portability/Windows.h>
+
 #include <memory>
 #include <thread>
 #include <assert.h>
 #include <semaphore.h>
-#include <gflags/gflags.h>
+
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
-#include <folly/Benchmark.h>
 
 using namespace folly;
 using namespace folly::detail;
@@ -182,27 +184,3 @@ TEST(MemoryIdler, futexWaitNeverFlush) {
   EXPECT_TRUE((MemoryIdler::futexWait<MockAtom, MockClock>(
       fut, 1, -1, MockClock::duration::max())));
 }
-
-
-BENCHMARK(releaseStack, iters) {
-  for (size_t i = 0; i < iters; ++i) {
-    MemoryIdler::unmapUnusedStack();
-  }
-}
-
-BENCHMARK(releaseMallocTLS, iters) {
-  for (size_t i = 0; i < iters; ++i) {
-    MemoryIdler::flushLocalMallocCaches();
-  }
-}
-
-int main(int argc, char** argv) {
-  testing::InitGoogleTest(&argc, argv);
-  gflags::ParseCommandLineFlags(&argc, &argv, true);
-
-  auto rv = RUN_ALL_TESTS();
-  if (!rv && FLAGS_benchmark) {
-    folly::runBenchmarks();
-  }
-  return rv;
-}