blob: 9515b967764e95f029157e5a964424a756f8b001 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
--- memory/mozalloc/mozalloc.cpp~
+++ memory/mozalloc/mozalloc.cpp
@@ -19,6 +19,9 @@
#if defined(XP_UNIX)
# include <unistd.h> // for valloc on *BSD
#endif //if defined(XP_UNIX)
+#if defined(__FreeBSD__)
+# include <malloc_np.h> // for malloc_usable_size
+#endif // if defined(__FreeBSD__)
#if defined(XP_WIN) || (defined(XP_OS2) && defined(__declspec))
# define MOZALLOC_EXPORT __declspec(dllexport)
@@ -210,7 +213,7 @@ moz_malloc_usable_size(void *ptr)
#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(__FreeBSD__)
// Android bionic libc doesn't have malloc_usable_size.
return malloc_usable_size(ptr);
#elif defined(XP_WIN)
|