Commit 41b865db authored by Scott Wolchok's avatar Scott Wolchok Committed by Facebook Github Bot

Malloc: Add flag for statically disabling jemalloc

Summary: Useful to disable this on some platforms.

Reviewed By: yfeldblum

Differential Revision: D16153556

fbshipit-source-id: ab5916c929f5987dad7daa0c66b229eaf7404c88
parent 66270d4e
...@@ -139,7 +139,11 @@ namespace folly { ...@@ -139,7 +139,11 @@ 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(FOLLY_ASSUME_NO_JEMALLOC)
inline bool usingJEMalloc() noexcept {
return false;
}
#elif defined(USE_JEMALLOC) && !FOLLY_SANITIZE
inline bool usingJEMalloc() noexcept { inline bool usingJEMalloc() noexcept {
return true; return true;
} }
......
...@@ -22,6 +22,10 @@ ...@@ -22,6 +22,10 @@
#include <folly/portability/Config.h> #include <folly/portability/Config.h>
#if (defined(USE_JEMALLOC) || defined(FOLLY_USE_JEMALLOC)) && !FOLLY_SANITIZE #if (defined(USE_JEMALLOC) || defined(FOLLY_USE_JEMALLOC)) && !FOLLY_SANITIZE
#if defined(FOLLY_ASSUME_NO_JEMALLOC)
#error \
"Both USE_JEMALLOC/FOLLY_USE_JEMALLOC and FOLLY_ASSUME_NO_JEMALLOC defined"
#endif
// 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> // @manual #include <jemalloc/jemalloc.h> // @manual
......
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