From 89166c82417a52f99dd373f510dd5119574dbf33 Mon Sep 17 00:00:00 2001 From: Giuseppe Ottaviano Date: Tue, 23 Aug 2016 10:14:40 -0700 Subject: [PATCH] Make Malloc.h self-contained again Summary: D3743475 adds to `Malloc.h` a dependency on another folly header, which breaks it when used in stand-alone mode. This diff moves the include to the right `#ifdef` section. Reviewed By: Gownta Differential Revision: D3757819 fbshipit-source-id: 71664ca6a3a47b6e4449a4ef603fedf052c5df3b --- folly/Malloc.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/folly/Malloc.h b/folly/Malloc.h index 64fd393d..fec188f5 100644 --- a/folly/Malloc.h +++ b/folly/Malloc.h @@ -20,8 +20,6 @@ #pragma once #define FOLLY_MALLOC_H_ -#include - /** * Define various MALLOCX_* macros normally provided by jemalloc. We define * them so that we don't have to include jemalloc.h, in case the program is @@ -42,6 +40,7 @@ #if defined(_GLIBCXX_USE_FB) && !defined(_LIBSTDCXX_FBSTRING) #include +#include #include @@ -87,13 +86,19 @@ extern "C" int mallctlbymib(const size_t*, size_t, void*, size_t*, void*, size_t) __attribute__((__weak__)); +#include + #define FOLLY_HAVE_MALLOC_H 1 -#else + +#else // !defined(_LIBSTDCXX_FBSTRING) + #include /* nolint */ +#include /* nolint */ + #endif // for malloc_usable_size -// NOTE: FreeBSD 9 doesn't have malloc.h. It's defitions +// NOTE: FreeBSD 9 doesn't have malloc.h. Its definitions // are found in stdlib.h. #if FOLLY_HAVE_MALLOC_H #include -- 2.34.1