Bug 743715 - Cannot build Fennec without jemalloc. r=glandium
authorGian-Carlo Pascutto <gpascutto@mozilla.com>
Wed, 11 Apr 2012 14:12:34 +0200
changeset 94736 5fcd261121c303caf581ef011398365eba86e151
parent 94735 966e23109ac29990428dccec6b269a6945bb5b48
child 94737 4dc5567fc431d584cd0f95283469a3d30c4b5524
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs743715
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 743715 - Cannot build Fennec without jemalloc. r=glandium
memory/mozalloc/mozalloc.cpp
mozglue/android/nsGeckoUtils.cpp
--- a/memory/mozalloc/mozalloc.cpp
+++ b/memory/mozalloc/mozalloc.cpp
@@ -238,20 +238,18 @@ moz_valloc(size_t size)
 size_t
 moz_malloc_usable_size(void *ptr)
 {
     if (!ptr)
         return 0;
 
 #if defined(XP_MACOSX)
     return malloc_size(ptr);
-#elif defined(MOZ_MEMORY) || defined(XP_LINUX)
-    // XXX: the |defined(XP_LINUX)| may be too lax;  some Linux installations
-    // might use a libc that doesn't have malloc_usable_size.  Let's fix this
-    // if/when it happens.
+#elif defined(MOZ_MEMORY) || (defined(XP_LINUX) && !defined(ANDROID))
+    // Android bionic libc doesn't have malloc_usable_size.
     return malloc_usable_size(ptr);
 #elif defined(XP_WIN)
     return _msize(ptr);
 #else
     return 0;
 #endif
 }
 
--- a/mozglue/android/nsGeckoUtils.cpp
+++ b/mozglue/android/nsGeckoUtils.cpp
@@ -31,21 +31,26 @@
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include <jni.h>
+
+#ifdef MOZ_MEMORY
 // Wrap malloc and free to use jemalloc
 #define malloc __wrap_malloc
 #define free __wrap_free
+#endif
+
 #include <stdlib.h>
 
+
 extern "C"
 __attribute__ ((visibility("default")))
 void JNICALL
 Java_org_mozilla_gecko_GeckoAppShell_putenv(JNIEnv *jenv, jclass, jstring map)
 {
     const char* str;
     // XXX: java doesn't give us true UTF8, we should figure out something 
     // better to do here