[scudo] Limit by default the TSD pool to 2 on Android
authorKostya Kortchinsky <kostyak@google.com>
Wed, 17 Jan 2018 21:54:48 +0000 (21:54 +0000)
committerKostya Kortchinsky <kostyak@google.com>
Wed, 17 Jan 2018 21:54:48 +0000 (21:54 +0000)
commit255913b3a0e03ea5f0faeff951caa5fc5c804a91
tree03821838324b2bf855a31bef181548eba5a92902
parentfe8e00bc3c65115b2e3d2a43cf3d0d756a934a52
[scudo] Limit by default the TSD pool to 2 on Android

Summary:
jemalloc on Android currently uses 2 arenas
(https://android.googlesource.com/platform/external/jemalloc/+/master/Android.bp#64).
Since the Android toolchain absorbs compiler-rt and compiles it as is, we have
to enforce the same limit to somehow stay competitive in terms of memory usage.

The changes could either go in:
- `scudo_platform.h` with a default for Android of 2 (this is the solution
  implemented here);
- in `CMakeLists.txt` adding -DSCUDO_SHARED_TSD_POOL_SIZE=2 for Android.
- something else?

I don't have a strong opinion on how to do it, but it has to be done upstream
anyway.

Reviewers: alekseyshl, eugenis

Reviewed By: alekseyshl, eugenis

Subscribers: srhines, #sanitizers, llvm-commits

Differential Revision: https://reviews.llvm.org/D42194

llvm-svn: 322764
compiler-rt/lib/scudo/scudo_platform.h