Move the clock details over to the Time.h portability header
[folly.git] / folly / detail / MemoryIdler.cpp
index 1f17f8cc37d1aa76bdcf70142680018b1654e1c8..bb9691b97fa36ac2b9396cd24c153d88b5cfeac9 100644 (file)
  */
 
 #include <folly/detail/MemoryIdler.h>
+
 #include <folly/Logging.h>
 #include <folly/Malloc.h>
+#include <folly/Portability.h>
 #include <folly/ScopeGuard.h>
 #include <folly/detail/CacheLocality.h>
 #include <limits.h>
 #include <pthread.h>
 #include <stdio.h>
 #include <string.h>
-#include <unistd.h>
 #include <sys/mman.h>
+#include <unistd.h>
 #include <utility>
 
-
 namespace folly { namespace detail {
 
 AtomicStruct<std::chrono::steady_clock::duration>
@@ -92,7 +93,8 @@ void MemoryIdler::flushLocalMallocCaches() {
 // Stack madvise isn't Linux or glibc specific, but the system calls
 // and arithmetic (and bug compatibility) are not portable.  The set of
 // platforms could be increased if it was useful.
-#if (FOLLY_X64 || FOLLY_PPC64 ) && defined(_GNU_SOURCE) && defined(__linux__)
+#if (FOLLY_X64 || FOLLY_PPC64) && defined(_GNU_SOURCE) && \
+    defined(__linux__) && !FOLLY_MOBILE
 
 static FOLLY_TLS uintptr_t tls_stackLimit;
 static FOLLY_TLS size_t tls_stackSize;