From: Igor Sugak Date: Fri, 1 Dec 2017 19:19:44 +0000 (-0800) Subject: unify FOLLY_SANITIZE existing uses and add a few new X-Git-Tag: v2017.12.04.00~5 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=d08cf1621ac39b4a23e9f4508222700ce68e9d4a unify FOLLY_SANITIZE existing uses and add a few new Reviewed By: yfeldblum Differential Revision: D6453972 fbshipit-source-id: fa083c0b782188f5f45a2a354045aee03e528829 --- diff --git a/folly/experimental/JemallocNodumpAllocator.h b/folly/experimental/JemallocNodumpAllocator.h index 16d6aec8..8b921d66 100644 --- a/folly/experimental/JemallocNodumpAllocator.h +++ b/folly/experimental/JemallocNodumpAllocator.h @@ -21,7 +21,7 @@ #include #include -#if defined(FOLLY_HAVE_LIBJEMALLOC) && !defined(FOLLY_SANITIZE) +#if defined(FOLLY_HAVE_LIBJEMALLOC) && !FOLLY_SANITIZE #include #include diff --git a/folly/memory/Malloc.h b/folly/memory/Malloc.h index 9eaf2c6c..c8aeaddd 100644 --- a/folly/memory/Malloc.h +++ b/folly/memory/Malloc.h @@ -19,6 +19,7 @@ #pragma once +#include #include /** @@ -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 #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 diff --git a/folly/memory/test/MallctlHelperTest.cpp b/folly/memory/test/MallctlHelperTest.cpp index 0b5444c8..f6027780 100644 --- a/folly/memory/test/MallctlHelperTest.cpp +++ b/folly/memory/test/MallctlHelperTest.cpp @@ -20,7 +20,7 @@ #include #include -#if defined(FOLLY_HAVE_LIBJEMALLOC) && !defined(FOLLY_SANITIZE) +#if defined(FOLLY_HAVE_LIBJEMALLOC) && !FOLLY_SANITIZE #include #endif diff --git a/folly/portability/Malloc.h b/folly/portability/Malloc.h index 1204c233..1c93d825 100755 --- a/folly/portability/Malloc.h +++ b/folly/portability/Malloc.h @@ -16,10 +16,12 @@ #pragma once -#include #include -#if defined(USE_JEMALLOC) || defined(FOLLY_USE_JEMALLOC) +#include +#include + +#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