summaryrefslogtreecommitdiffstats
path: root/main/xulrunner/uclibc-malloc_usable_size.patch
blob: 4d088787c3c9b6eb149c0c5c2a43ea7c0cbed972 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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) $(call EXPAND_LIBNAME_PATH,memory,../build)
+endif
+
 VISIBILITY_FLAGS=
 STL_FLAGS	=
 ifdef _MSC_VER