aboutsummaryrefslogtreecommitdiff
path: root/Android.bp
diff options
context:
space:
mode:
Diffstat (limited to 'Android.bp')
-rw-r--r--Android.bp58
1 files changed, 20 insertions, 38 deletions
diff --git a/Android.bp b/Android.bp
index a2c8fb5..e7d9ea0 100644
--- a/Android.bp
+++ b/Android.bp
@@ -44,10 +44,9 @@ common_cflags = [
// usually decreases the amount of PSS used, but can increase
// fragmentation.
-android_common_cflags = [
- // Default to a single arena for svelte configurations to minimize
- // PSS. This will be overridden by android_product_variables for
- // non-svelte configs.
+// Default to a single arena for svelte configurations to minimize
+// PSS consumed by jemalloc.
+common_cflags += [
"-DANDROID_MAX_ARENAS=1",
"-DANDROID_LG_TCACHE_MAXCLASS_DEFAULT=16",
]
@@ -57,7 +56,7 @@ common_c_local_includes = [
"include",
]
-android_product_variables = {
+common_product_variables = {
// Only enable the tcache on non-svelte configurations, to save PSS.
malloc_not_svelte: {
cflags: [
@@ -73,20 +72,9 @@ android_product_variables = {
cc_defaults {
name: "jemalloc_defaults",
defaults: ["linux_bionic_supported"],
- host_supported: true,
cflags: common_cflags,
- target: {
- android: {
- cflags: android_common_cflags + [
- "-include android/include/log.h",
- ],
- product_variables: android_product_variables,
- },
- linux_glibc: {
- enabled: true,
- },
- },
+ product_variables: common_product_variables,
multilib: {
lib32: {
@@ -144,19 +132,13 @@ lib_src_files = [
//-----------------------------------------------------------------------
// jemalloc static library
//-----------------------------------------------------------------------
-cc_library {
+cc_library_static {
name: "libjemalloc",
recovery_available: true,
defaults: ["jemalloc_defaults"],
- target: {
- android: {
- shared: {
- enabled: false,
- },
- },
- },
+ cflags: ["-include bionic/libc/async_safe/include/async_safe/log.h"],
srcs: lib_src_files,
}
@@ -171,6 +153,7 @@ cc_library_static {
cflags: [
"-DJEMALLOC_JET",
+ "-include android/include/log.h",
],
srcs: lib_src_files,
@@ -197,8 +180,10 @@ cc_library_static {
name: "libjemalloc_unittest",
defaults: ["jemalloc_defaults"],
+
cflags: [
"-DJEMALLOC_UNIT_TEST",
+ "-include android/include/log.h",
],
local_include_dirs: [
@@ -209,6 +194,7 @@ cc_library_static {
srcs: jemalloc_testlib_srcs,
whole_static_libs: ["libjemalloc_jet"],
+
}
//-----------------------------------------------------------------------
@@ -261,12 +247,13 @@ unit_tests = [
cc_test {
name: "jemalloc_unittests",
- defaults: ["jemalloc_defaults"],
-
gtest: false,
+ product_variables: common_product_variables,
+
cflags: common_cflags + [
"-DJEMALLOC_UNIT_TEST",
+ "-include android/include/log.h",
],
local_include_dirs: common_c_local_includes + [
@@ -293,6 +280,7 @@ cc_library_static {
cflags: [
"-DJEMALLOC_INTEGRATION_TEST",
+ "-include android/include/log.h",
],
local_include_dirs: [
@@ -311,6 +299,7 @@ integration_tests = [
"test/integration/aligned_alloc.c",
"test/integration/allocated.c",
"test/integration/chunk.c",
+ "test/integration/iterate.c",
"test/integration/MALLOCX_ARENA.c",
"test/integration/mallocx.c",
"test/integration/overflow.c",
@@ -322,19 +311,17 @@ integration_tests = [
"test/integration/xallocx.c",
]
-android_integration_tests = [
- "test/integration/iterate.c",
-]
-
cc_test {
- name: "jemalloc_integrationtests",
- defaults: ["jemalloc_defaults"],
+ name: "jemalloc_integrationtests",
gtest: false,
+ product_variables: common_product_variables,
+
cflags: common_cflags + [
"-DJEMALLOC_INTEGRATION_TEST",
+ "-include android/include/log.h",
],
local_include_dirs: common_c_local_includes + [
@@ -343,11 +330,6 @@ cc_test {
],
srcs: integration_tests,
- target: {
- android: {
- srcs: android_integration_tests,
- },
- },
static_libs: ["libjemalloc_integrationtest"],