Fix some copyright lines in folly/detail/ and folly/test/
[folly.git] / folly / memory / Malloc.h
index e774dd0e907bffe80f1c473ac4ac872685906054..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
@@ -144,13 +145,14 @@ namespace folly {
 #define FOLLY_MALLOC_CHECKED_MALLOC
 #endif
 
+#include <folly/CPortability.h>
 /**
  * Determine if we are using jemalloc or not.
  */
-#ifdef USE_JEMALLOC
-inline bool usingJEMalloc() noexcept {
-  return true;
-}
+#if defined(USE_JEMALLOC) && !FOLLY_SANITIZE
+  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