aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2018-10-22 15:42:12 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-10-22 15:42:12 -0700
commit3a57670252c9678678fe35fcd842855cadc4aae3 (patch)
treed9dfac14882e3092be431d7c1fe264df06f976ce
parenta517fc5366709135ec88172e12c44bd641ac7ebf (diff)
parent9447c6b21bb0aa684b5bea9f74f1277058743a04 (diff)
downloadjemalloc-3a57670252c9678678fe35fcd842855cadc4aae3.tar.gz
Fix settings for host bionic
am: 9447c6b21b Change-Id: Idac3d417e8ec35524fc3bdff6f83cbad33d0d9a6
-rw-r--r--Android.bp3
-rw-r--r--include/jemalloc/internal/jemalloc_internal_defs.h5
-rw-r--r--include/jemalloc/jemalloc.h2
-rw-r--r--src/jemalloc.c2
4 files changed, 9 insertions, 3 deletions
diff --git a/Android.bp b/Android.bp
index bc22a71..cea3a8d 100644
--- a/Android.bp
+++ b/Android.bp
@@ -83,6 +83,9 @@ cc_defaults {
],
product_variables: android_product_variables,
},
+ linux_bionic: {
+ cflags: ["-DJEMALLOC_TCACHE"],
+ },
linux_glibc: {
enabled: true,
},
diff --git a/include/jemalloc/internal/jemalloc_internal_defs.h b/include/jemalloc/internal/jemalloc_internal_defs.h
index 9ffe26c..03d537e 100644
--- a/include/jemalloc/internal/jemalloc_internal_defs.h
+++ b/include/jemalloc/internal/jemalloc_internal_defs.h
@@ -1,4 +1,7 @@
-#if !defined(__ANDROID__)
+/* Include cdefs to see if __BIONIC__ is set */
+#include <sys/cdefs.h>
+
+#if !defined(__BIONIC__)
#include "jemalloc_internal_defs_host.h"
#else
/* include/jemalloc/internal/jemalloc_internal_defs.h. Generated from jemalloc_internal_defs.h.in by configure. */
diff --git a/include/jemalloc/jemalloc.h b/include/jemalloc/jemalloc.h
index 8f88f6d..c5dc830 100644
--- a/include/jemalloc/jemalloc.h
+++ b/include/jemalloc/jemalloc.h
@@ -64,7 +64,7 @@ extern "C" {
* these macro definitions.
*/
#ifndef JEMALLOC_NO_RENAME
-#if defined(__ANDROID__)
+#if defined(__BIONIC__)
# define je_malloc_conf je_malloc_conf
# define je_malloc_message je_malloc_message
# define je_malloc je_malloc
diff --git a/src/jemalloc.c b/src/jemalloc.c
index c2bafc5..670b0ae 100644
--- a/src/jemalloc.c
+++ b/src/jemalloc.c
@@ -2930,7 +2930,7 @@ jemalloc_postfork_child(void)
/******************************************************************************/
-#if defined(__ANDROID__)
+#if defined(__BIONIC__)
/* ANDROID extension */
#include "android_je_iterate.c"
#include "android_je_mallinfo.c"