diff options
author | Kostya Kortchinsky <kostyak@google.com> | 2017-11-21 21:14:00 +0000 |
---|---|---|
committer | Kostya Kortchinsky <kostyak@google.com> | 2017-11-21 21:14:00 +0000 |
commit | 8d1ef4a759edc138efdfab9c86047739fab8a536 (patch) | |
tree | cf71bb163e1b7ccb5ebc429352d6ce8661eeb0b9 /lib/sanitizer_common/sanitizer_fuchsia.cc | |
parent | f5c4e6980b9a03990cbe80ce7eb85029fd9b37de (diff) |
[scudo] Make getNumberOfCPUs Fuchsia compliant v2
Summary:
This change allows Fuchsia to boot properly using the Scudo allocator.
A first version of this commit was reverted by rL317834 because it broke Android
builds for toolchains generated with older NDKs. This commit introduces a
fall back to solve that issue.
Reviewers: cryptoad, krytarowski, rnk, alekseyshl
Reviewed By: cryptoad, krytarowski, alekseyshl
Subscribers: llvm-commits, srhines, kubamracek, krytarowski
Differential Revision: https://reviews.llvm.org/D40121
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318802 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_fuchsia.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_fuchsia.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_fuchsia.cc b/lib/sanitizer_common/sanitizer_fuchsia.cc index c130c10c2..23df9aad5 100644 --- a/lib/sanitizer_common/sanitizer_fuchsia.cc +++ b/lib/sanitizer_common/sanitizer_fuchsia.cc @@ -528,6 +528,10 @@ bool GetRandom(void *buffer, uptr length, bool blocking) { return true; } +u32 GetNumberOfCPUs() { + return zx_system_get_num_cpus(); +} + } // namespace __sanitizer using namespace __sanitizer; // NOLINT |