[scudo] Allow to specify the maximum number of TSDs at compile time
authorKostya Kortchinsky <kostyak@google.com>
Fri, 27 Oct 2017 20:10:14 +0000 (20:10 +0000)
committerKostya Kortchinsky <kostyak@google.com>
Fri, 27 Oct 2017 20:10:14 +0000 (20:10 +0000)
commit91b7558ca888096483614ed92166f67c3c91027e
treebfe087209abfa61d9bf7f309d9a64eac7d543774
parent8f6e8ed9dd246afbf002c04108a03cb6142b82bd
[scudo] Allow to specify the maximum number of TSDs at compile time

Summary:
This introduces `SCUDO_MAX_CACHES` allowing to define an upper bound to the
number of `ScudoTSD` created in the Shared TSD model (by default 32U).
This name felt clearer than `SCUDO_MAX_TSDS` which is technically what it really
is. I am opened to suggestions if that doesn't feel right.

Additionally change `getNumberOfCPUs` to return a `u32` to be more consistent.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: llvm-commits

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

llvm-svn: 316788
compiler-rt/lib/scudo/scudo_platform.h
compiler-rt/lib/scudo/scudo_tsd_shared.cpp