Commit d08cf162 authored by Igor Sugak's avatar Igor Sugak Committed by Facebook Github Bot

unify FOLLY_SANITIZE existing uses and add a few new

Reviewed By: yfeldblum

Differential Revision: D6453972

fbshipit-source-id: fa083c0b782188f5f45a2a354045aee03e528829
parent 730db44f
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <folly/CPortability.h> #include <folly/CPortability.h>
#include <folly/portability/Config.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 <folly/portability/SysMman.h>
#include <jemalloc/jemalloc.h> #include <jemalloc/jemalloc.h>
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#pragma once #pragma once
#include <folly/CPortability.h>
#include <folly/portability/Config.h> #include <folly/portability/Config.h>
/** /**
...@@ -26,7 +27,7 @@ ...@@ -26,7 +27,7 @@
* them so that we don't have to include jemalloc.h, in case the program is * them so that we don't have to include jemalloc.h, in case the program is
* built without jemalloc support. * 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. // We have JEMalloc, so use it.
# include <jemalloc/jemalloc.h> # include <jemalloc/jemalloc.h>
#else #else
...@@ -149,9 +150,9 @@ namespace folly { ...@@ -149,9 +150,9 @@ namespace folly {
* Determine if we are using jemalloc or not. * Determine if we are using jemalloc or not.
*/ */
#if defined(USE_JEMALLOC) && !FOLLY_SANITIZE #if defined(USE_JEMALLOC) && !FOLLY_SANITIZE
inline bool usingJEMalloc() noexcept { inline bool usingJEMalloc() noexcept {
return true; return true;
} }
#else #else
FOLLY_MALLOC_NOINLINE inline bool usingJEMalloc() noexcept { FOLLY_MALLOC_NOINLINE inline bool usingJEMalloc() noexcept {
// Checking for rallocx != nullptr is not sufficient; we may be in a // Checking for rallocx != nullptr is not sufficient; we may be in a
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <folly/memory/Malloc.h> #include <folly/memory/Malloc.h>
#include <folly/portability/GTest.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> #include <jemalloc/jemalloc.h>
#endif #endif
......
...@@ -16,10 +16,12 @@ ...@@ -16,10 +16,12 @@
#pragma once #pragma once
#include <folly/portability/Config.h>
#include <stdlib.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 // JEMalloc provides it's own implementation of
// malloc_usable_size, and that's what we should be using. // malloc_usable_size, and that's what we should be using.
#include <jemalloc/jemalloc.h> #include <jemalloc/jemalloc.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment