From 3bde358c1846b139149027a66b0c593ed21800ec Mon Sep 17 00:00:00 2001 From: Peter Griess Date: Tue, 26 Nov 2013 12:11:40 -0800 Subject: [PATCH] Define weak r?allocm symbols in Malloc.h Summary: - This fixes a bug introduced in D1002959 that broke -fb platform compilation: there was noone to forward-declare these symbols. Test Plan: - Built the gcc-4.8.1-glibc-2.17-fb platform - fbconfig -r folly && fbmake runtests - configure/make check on Mac OS X Reviewed By: andrei.alexandrescu@fb.com FB internal diff: D1074720 Blame Revision: D1002959 --- folly/Malloc.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/folly/Malloc.h b/folly/Malloc.h index e65ce226..72c0fb10 100644 --- a/folly/Malloc.h +++ b/folly/Malloc.h @@ -43,6 +43,17 @@ namespace folly { #ifdef _LIBSTDCXX_FBSTRING #pragma GCC system_header + +/** + * Declare rallocm() and allocm() as weak symbols. These will be provided by + * jemalloc if we are using jemalloc, or will be NULL if we are using another + * malloc implementation. + */ +extern "C" int rallocm(void**, size_t*, size_t, size_t, int) +__attribute__((weak)); +extern "C" int allocm(void**, size_t*, size_t, int) +__attribute__((weak)); + #define FOLLY_HAVE_MALLOC_H 1 #else #include "folly/detail/Malloc.h" -- 2.34.1