Bug 1115078 - Unbreak MOZ_JEMALLOC3 build on FreeBSD after bug 899126. r=glandium
authorJan Beich <jbeich@vfemail.net>
Tue, 23 Dec 2014 12:32:00 -0500
changeset 238126 b1b9af321bac85386bac98a3b7f17c1e70ad3c83
parent 238125 866eedaf819c745d9a38a8bd96046e17377931e8
child 238127 5f429eb915588e9551fb1168d5f2920d7e0e09c8
push id7472
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 20:36:27 +0000
treeherdermozilla-aurora@300ca104f8fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1115078, 899126
milestone37.0a1
Bug 1115078 - Unbreak MOZ_JEMALLOC3 build on FreeBSD after bug 899126. r=glandium
configure.in
memory/build/mozjemalloc_compat.c
--- a/configure.in
+++ b/configure.in
@@ -3411,16 +3411,18 @@ MALLOC_H=
 for file in $MALLOC_HEADERS; do
   MOZ_CHECK_HEADER($file, [MALLOC_H=$file])
   if test "$MALLOC_H" != ""; then
     AC_DEFINE_UNQUOTED(MALLOC_H, <$MALLOC_H>)
     break
   fi
 done
 
+MOZ_CHECK_HEADERS(alloca.h)
+
 AC_CHECK_FUNCS(strndup posix_memalign memalign)
 
 AC_CHECK_FUNCS(malloc_usable_size)
 
 dnl In newer bionic headers, valloc is built but not defined,
 dnl so we check more carefully here.
 AC_MSG_CHECKING([for valloc in malloc.h])
 AC_EGREP_HEADER(valloc, malloc.h,
--- a/memory/build/mozjemalloc_compat.c
+++ b/memory/build/mozjemalloc_compat.c
@@ -5,17 +5,16 @@
 #ifndef MOZ_JEMALLOC3
 #  error Should only compile this file when building with jemalloc 3
 #endif
 
 #define MOZ_JEMALLOC_IMPL
 
 #include "mozmemory_wrap.h"
 #include "jemalloc_types.h"
-#include "jemalloc/internal/jemalloc_internal_defs.h" // for JEMALLOC_HAS_ALLOCA_H
 #include "mozilla/Types.h"
 
 #include <stdbool.h>
 
 #if defined(MOZ_NATIVE_JEMALLOC)
 
 MOZ_IMPORT_API int
 je_(mallctl)(const char*, void*, size_t*, void*, size_t);
@@ -64,17 +63,17 @@ je_(nallocx)(size_t size, int flags);
  * VARIABLE_ARRAY is copied from
  * memory/jemalloc/src/include/jemalloc/internal/jemalloc_internal.h.in
  */
 #if __STDC_VERSION__ < 199901L
 #  ifdef _MSC_VER
 #    include <malloc.h>
 #    define alloca _alloca
 #  else
-#    ifdef JEMALLOC_HAS_ALLOCA_H
+#    ifdef HAVE_ALLOCA_H
 #      include <alloca.h>
 #    else
 #      include <stdlib.h>
 #    endif
 #  endif
 #  define VARIABLE_ARRAY(type, name, count) \
 	type *name = alloca(sizeof(type) * (count))
 #else