aboutsummaryrefslogtreecommitdiffstats
path: root/main/xulrunner/0004-xulrunner-malloc_usable_size.patch
blob: 986b183ece08ad800e29298490c301ecb003779a (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
From: Timo Teräs <timo.teras@iki.fi>

malloc_usable_size is not defined on uclibc, so workaround
that in jemalloc. Fix mozalloc linking.

--- mozilla-release-old/memory/jemalloc/jemalloc.h
+++ mozilla-release/memory/jemalloc/jemalloc.h
@@ -75,8 +75,12 @@
 /* Linux has memalign and malloc_usable_size */
 #if !defined(MOZ_MEMORY_LINUX)
 void	*memalign(size_t alignment, size_t size);
-size_t	malloc_usable_size(const void *ptr);
 #endif /* MOZ_MEMORY_LINUX */
+
+#include <features.h>
+#if defined(__UCLIBC__) || !defined(MOZ_MEMORY_LINUX)
+size_t	malloc_usable_size(const void *ptr);
+#endif
 
 void	jemalloc_stats(jemalloc_stats_t *stats);
 
--- 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