aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2019-04-30 17:45:48 -0700
committerChristopher Ferris <cferris@google.com>2019-04-30 19:01:24 -0700
commita8b52518654725e64def5ebbd0ed472100e5a522 (patch)
treea6edbb65b0e78d322d24be0a0f49c37b917e4576 /include
parent0af4ee86dfa643feb786d659dbb219133c776a34 (diff)
downloadplatform_external_jemalloc_new-a8b52518654725e64def5ebbd0ed472100e5a522.tar.gz
platform_external_jemalloc_new-a8b52518654725e64def5ebbd0ed472100e5a522.tar.bz2
platform_external_jemalloc_new-a8b52518654725e64def5ebbd0ed472100e5a522.zip
Remove unused stats from cache structure.
Removing the stats make the whole cache structure fit in a single page. Bug: 131362671 Test: Verified that all bionic malloc benchmarks are still the same. Test: It turns out that the malloc_sql benchmarks seem to get faster. Test: Verified that after this change, it saves about 2K PSS per thread. Change-Id: I4dcd633543f05f1a9d47db175f9977ddb42188a9
Diffstat (limited to 'include')
-rw-r--r--include/jemalloc/internal/cache_bin.h3
-rw-r--r--include/jemalloc/internal/tcache_inlines.h4
2 files changed, 7 insertions, 0 deletions
diff --git a/include/jemalloc/internal/cache_bin.h b/include/jemalloc/internal/cache_bin.h
index 12f3ef2d..bf73c7d1 100644
--- a/include/jemalloc/internal/cache_bin.h
+++ b/include/jemalloc/internal/cache_bin.h
@@ -46,12 +46,15 @@ struct cache_bin_s {
cache_bin_sz_t low_water;
/* # of cached objects. */
cache_bin_sz_t ncached;
+ /* Removing this variable make the cache_t structure fit in a single page. */
+#if defined(ANDROID_ENABLE_TCACHE_STATS)
/*
* ncached and stats are both modified frequently. Let's keep them
* close so that they have a higher chance of being on the same
* cacheline, thus less write-backs.
*/
cache_bin_stats_t tstats;
+#endif
/*
* Stack of available objects.
*
diff --git a/include/jemalloc/internal/tcache_inlines.h b/include/jemalloc/internal/tcache_inlines.h
index 0f6ab8cb..0859c4e7 100644
--- a/include/jemalloc/internal/tcache_inlines.h
+++ b/include/jemalloc/internal/tcache_inlines.h
@@ -90,9 +90,11 @@ tcache_alloc_small(tsd_t *tsd, arena_t *arena, tcache_t *tcache,
memset(ret, 0, usize);
}
+#if defined(ANDROID_ENABLE_TCACHE_STATS)
if (config_stats) {
bin->tstats.nrequests++;
}
+#endif
if (config_prof) {
tcache->prof_accumbytes += usize;
}
@@ -148,9 +150,11 @@ tcache_alloc_large(tsd_t *tsd, arena_t *arena, tcache_t *tcache, size_t size,
memset(ret, 0, usize);
}
+#if defined(ANDROID_ENABLE_TCACHE_STATUS)
if (config_stats) {
bin->tstats.nrequests++;
}
+#endif
if (config_prof) {
tcache->prof_accumbytes += usize;
}