unify FOLLY_SANITIZE existing uses and add a few new
authorIgor Sugak <sugak@fb.com>
Fri, 1 Dec 2017 19:19:44 +0000 (11:19 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 1 Dec 2017 19:26:53 +0000 (11:26 -0800)
Reviewed By: yfeldblum

Differential Revision: D6453972

fbshipit-source-id: fa083c0b782188f5f45a2a354045aee03e528829

folly/experimental/JemallocNodumpAllocator.h
folly/memory/Malloc.h
folly/memory/test/MallctlHelperTest.cpp
folly/portability/Malloc.h

index 16d6aec8a41970071bb8dc8087ffe0322f499381..8b921d66d99a4a25b9f1123f1469560eff0cdcf8 100644 (file)
@@ -21,7 +21,7 @@
 #include <folly/CPortability.h>
 #include <folly/portability/Config.h>
 
-#if defined(FOLLY_HAVE_LIBJEMALLOC) && !defined(FOLLY_SANITIZE)
+#if defined(FOLLY_HAVE_LIBJEMALLOC) && !FOLLY_SANITIZE
 
 #include <folly/portability/SysMman.h>
 #include <jemalloc/jemalloc.h>
index 9eaf2c6ccec0f2777614262295924f32ed8d1dc9..c8aeaddd4573bacbf9e1f244be326f150d789eaa 100644 (file)
@@ -19,6 +19,7 @@
 
 #pragma once
 
+#include <folly/CPortability.h>
 #include <folly/portability/Config.h>
 
 /**
@@ -26,7 +27,7 @@
  * them so that we don't have to include jemalloc.h, in case the program is
  * built without jemalloc support.
  */
-#if defined(USE_JEMALLOC) || defined(FOLLY_USE_JEMALLOC)
+#if (defined(USE_JEMALLOC) || defined(FOLLY_USE_JEMALLOC)) && !FOLLY_SANITIZE
 // We have JEMalloc, so use it.
 # include <jemalloc/jemalloc.h>
 #else
@@ -149,9 +150,9 @@ namespace folly {
  * Determine if we are using jemalloc or not.
  */
 #if defined(USE_JEMALLOC) && !FOLLY_SANITIZE
-inline bool usingJEMalloc() noexcept {
-  return true;
-}
+  inline bool usingJEMalloc() noexcept {
+    return true;
+  }
 #else
 FOLLY_MALLOC_NOINLINE inline bool usingJEMalloc() noexcept {
   // Checking for rallocx != nullptr is not sufficient; we may be in a
index 0b5444c86ecb50953bf88eac268b763c571f581e..f6027780b07bc3ad1b723a69aeec1534d7e378f3 100644 (file)
@@ -20,7 +20,7 @@
 #include <folly/memory/Malloc.h>
 #include <folly/portability/GTest.h>
 
-#if defined(FOLLY_HAVE_LIBJEMALLOC) && !defined(FOLLY_SANITIZE)
+#if defined(FOLLY_HAVE_LIBJEMALLOC) && !FOLLY_SANITIZE
 #include <jemalloc/jemalloc.h>
 #endif
 
index 1204c23365d8036ecccb92ebd319f79406fea301..1c93d825af3ffcdb1d7bd8f13001c2e811572325 100755 (executable)
 
 #pragma once
 
-#include <folly/portability/Config.h>
 #include <stdlib.h>
 
-#if defined(USE_JEMALLOC) || defined(FOLLY_USE_JEMALLOC)
+#include <folly/CPortability.h>
+#include <folly/portability/Config.h>
+
+#if (defined(USE_JEMALLOC) || defined(FOLLY_USE_JEMALLOC)) && !FOLLY_SANITIZE
 // JEMalloc provides it's own implementation of
 // malloc_usable_size, and that's what we should be using.
 #include <jemalloc/jemalloc.h>