Replace malloc_not_svelte with malloc_low_memory.
The malloc_not_svelte variable name is confusing and makes the
low memory config the default. Change this so that the default is
the regular allocator, and that malloc_low_memory is used to enable
the low memory allocator.
Update blueprint rules so that the default config is not the
low memory one.
Test: Verified scudo config is used by default.
Test: Verfified Android GO config uses the jemalloc low memory config.
Change-Id: I5b34c6f65e50fc3556a31d5a5b72509f4ff9ae75
diff --git a/Android.bp b/Android.bp
index 59db8a3..fb1a85c 100644
--- a/Android.bp
+++ b/Android.bp
@@ -92,30 +92,30 @@
// 1 << XX is the maximum sized allocation that will be in the tcache.
android_common_cflags = [
- // Default some parameters to small values to minimize PSS.
- // These parameters will be overridden by android_product_variables
- // for non-svelte configs.
- "-DANDROID_NUM_ARENAS=1",
- // This value cannot go below 2.
- "-DANDROID_TCACHE_NSLOTS_SMALL_MAX=2",
- "-DANDROID_TCACHE_NSLOTS_LARGE=1",
+ // Default parameters for jemalloc config.
+ "-DANDROID_ENABLE_TCACHE",
+ "-DANDROID_LG_TCACHE_MAXCLASS_DEFAULT=16",
+ "-DANDROID_NUM_ARENAS=2",
+ "-DANDROID_TCACHE_NSLOTS_SMALL_MAX=8",
+ "-DANDROID_TCACHE_NSLOTS_LARGE=16",
]
android_product_variables = {
- // Only enable the tcache on non-svelte configurations, to save PSS.
- malloc_not_svelte: {
+ malloc_low_memory: {
+ // Parameters to minimize RSS.
cflags: [
- "-DANDROID_ENABLE_TCACHE",
- "-DANDROID_LG_TCACHE_MAXCLASS_DEFAULT=16",
+ // Disable the tcache on non-svelte configurations, to save PSS.
+ "-UANDROID_ENABLE_TCACHE",
"-UANDROID_NUM_ARENAS",
- "-DANDROID_NUM_ARENAS=2",
+ "-DANDROID_NUM_ARENAS=1",
+ // This value cannot go below 2.
"-UANDROID_TCACHE_NSLOTS_SMALL_MAX",
- "-DANDROID_TCACHE_NSLOTS_SMALL_MAX=8",
+ "-DANDROID_TCACHE_NSLOTS_SMALL_MAX=2",
"-UANDROID_TCACHE_NSLOTS_LARGE",
- "-DANDROID_TCACHE_NSLOTS_LARGE=16",
+ "-DANDROID_TCACHE_NSLOTS_LARGE=1",
],
},
}