aboutsummaryrefslogtreecommitdiffstats
path: root/main/xulrunner/uclibc-malloc_usable_size.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/xulrunner/uclibc-malloc_usable_size.patch')
-rw-r--r--main/xulrunner/uclibc-malloc_usable_size.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/main/xulrunner/uclibc-malloc_usable_size.patch b/main/xulrunner/uclibc-malloc_usable_size.patch
new file mode 100644
index 0000000000..b198e2cc56
--- /dev/null
+++ b/main/xulrunner/uclibc-malloc_usable_size.patch
@@ -0,0 +1,37 @@
+--- ./memory/mozalloc/mozalloc.cpp.orig
++++ ./memory/mozalloc/mozalloc.cpp
+@@ -63,7 +63,7 @@
+ #include "mozilla/mozalloc_oom.h" // for mozalloc_handle_oom
+
+ /* Windows doesn't have malloc_usable_size, but jemalloc has */
+-#if defined(MOZ_MEMORY_WINDOWS)
++#if defined(MOZ_MEMORY_WINDOWS) || defined(__UCLIBC__)
+ extern "C" size_t malloc_usable_size(const void *ptr);
+ #endif
+
+@@ -243,10 +243,10 @@
+
+ #if defined(XP_MACOSX)
+ return malloc_size(ptr);
+-#elif defined(MOZ_MEMORY) || (defined(XP_LINUX) && !defined(ANDROID))
++#elif defined(MOZ_MEMORY) || (defined(XP_LINUX) && !defined(ANDROID) &&!defined(__UCLIBC__))
+ // Android bionic libc doesn't have malloc_usable_size.
+ return malloc_usable_size(ptr);
+-#elif defined(XP_WIN)
++#elif defined(XP_WIN) || defined(__UCLIBC__)
+ return _msize(ptr);
+ #else
+ return 0;
+--- mozilla-release-old/memory/mozalloc/Makefile.in
++++ mozilla-release/memory/mozalloc/Makefile.in
+@@ -43,6 +43,10 @@
+
+ include $(DEPTH)/config/autoconf.mk
+
++ifdef MOZ_MEMORY
++SHARED_LIBRARY_LIBS = $(call EXPAND_LIBNAME_PATH,jemalloc,../jemalloc)
++endif
++
+ VISIBILITY_FLAGS=
+ STL_FLAGS =
+ ifdef _MSC_VER