diff --git a/folly/memory/test/MallctlHelperTest.cpp b/folly/memory/test/MallctlHelperTest.cpp index df551abfe65..07a035eee13 100644 --- a/folly/memory/test/MallctlHelperTest.cpp +++ b/folly/memory/test/MallctlHelperTest.cpp @@ -19,11 +19,15 @@ #if defined(FOLLY_USE_JEMALLOC) && (!defined(FOLLY_SANITIZE) || !FOLLY_SANITIZE) #include +#if defined(__FreeBSD__) +#include +#else #include +#endif using namespace folly; -#if JEMALLOC_VERSION_MAJOR > 4 +#if defined(JEMALLOC_VERSION_MAJOR) && JEMALLOC_VERSION_MAJOR > 4 static constexpr char const* kDecayCmd = "arena.0.dirty_decay_ms"; #else static constexpr char const* kDecayCmd = "arena.0.decay_time"; diff --git a/folly/portability/Malloc.h b/folly/portability/Malloc.h index 8e785a9c728..2985c65b231 100644 --- a/folly/portability/Malloc.h +++ b/folly/portability/Malloc.h @@ -37,8 +37,9 @@ #define FOLLY_HAS_JEMALLOC_DEFS 1 #endif #else -#if !defined(__FreeBSD__) -#if __has_include() +#if defined(__FreeBSD__) +#include // @manual +#elif __has_include() #include #endif #define FOLLY_HAS_JEMALLOC_DEFS 0