summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2014-07-10 18:53:41 -0700
committerChristopher Ferris <cferris@google.com>2014-07-11 11:01:30 -0700
commit8e32b7b3543eadbb58a92443fb57d60aac92ef88 (patch)
tree1020766b7e8d6f930fa671174dbd733b9e810f7c
parentc6bc001776931fd1c8583df2b8948dcb8bf61007 (diff)
downloadbionic-8e32b7b3543eadbb58a92443fb57d60aac92ef88.zip
bionic-8e32b7b3543eadbb58a92443fb57d60aac92ef88.tar.gz
bionic-8e32b7b3543eadbb58a92443fb57d60aac92ef88.tar.bz2
Make jemalloc the default choice.
Change-Id: I5ff0cf0c396b7ae6278e6fcd5a0d50f8b966fb54
-rw-r--r--CleanSpec.mk4
-rw-r--r--libc/Android.mk17
-rw-r--r--tests/Android.mk10
3 files changed, 17 insertions, 14 deletions
diff --git a/CleanSpec.mk b/CleanSpec.mk
index b84e1b6..841ad16 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -44,6 +44,10 @@
#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
+# Switching to jemalloc requires deleting these files.
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libc_*)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libc_*)
+
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
diff --git a/libc/Android.mk b/libc/Android.mk
index 5acdd6b..765f4d2 100644
--- a/libc/Android.mk
+++ b/libc/Android.mk
@@ -515,12 +515,13 @@ ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
libc_common_cflags += -DDEBUG
endif
-ifeq ($(MALLOC_IMPL),jemalloc)
- libc_common_cflags += -DUSE_JEMALLOC
- libc_malloc_src := bionic/jemalloc_wrapper.cpp
-else
+ifeq ($(MALLOC_IMPL),dlmalloc)
libc_common_cflags += -DUSE_DLMALLOC
libc_malloc_src := bionic/dlmalloc.c
+else
+ libc_common_cflags += -DUSE_JEMALLOC
+ libc_malloc_src := bionic/jemalloc_wrapper.cpp
+ libc_common_c_includes += external/jemalloc/include
endif
# To customize dlmalloc's alignment, set BOARD_MALLOC_ALIGNMENT in
@@ -547,14 +548,10 @@ libc_common_cppflags := \
# Define some common includes
# ========================================================
-libc_common_c_includes := \
+libc_common_c_includes += \
$(LOCAL_PATH)/stdlib \
$(LOCAL_PATH)/stdio \
-ifeq ($(MALLOC_IMPL),jemalloc)
- libc_common_c_includes += external/jemalloc/include
-endif
-
# ========================================================
# Add in the arch-specific flags.
# Must be called with $(eval).
@@ -873,7 +870,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \
LOCAL_WHOLE_STATIC_LIBRARIES_arm := libc_aeabi
-ifeq ($(MALLOC_IMPL),jemalloc)
+ifneq ($(MALLOC_IMPL),dlmalloc)
LOCAL_WHOLE_STATIC_LIBRARIES += libjemalloc
endif
diff --git a/tests/Android.mk b/tests/Android.mk
index 278511b..3e8fbe6 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -40,7 +40,9 @@ test_cflags = \
test_cflags += -D__STDC_LIMIT_MACROS # For glibc.
-ifeq ($(MALLOC_IMPL),jemalloc)
+ifeq ($(MALLOC_IMPL),dlmalloc)
+test_cflags += -DUSE_DLMALLOC
+else
test_cflags += -DUSE_JEMALLOC
endif
@@ -115,10 +117,10 @@ libBionicStandardTests_src_files := \
libBionicStandardTests_cflags := \
$(test_cflags) \
-ifeq ($(MALLOC_IMPL),jemalloc)
- libBionicStandardTests_cflags += -DUSE_JEMALLOC
-else
+ifeq ($(MALLOC_IMPL),dlmalloc)
libBionicStandardTests_cflags += -DUSE_DLMALLOC
+else
+ libBionicStandardTests_cflags += -DUSE_JEMALLOC
endif
libBionicStandardTests_cppflags := \