diff options
author | Francis Ricci <francisjricci@gmail.com> | 2017-05-19 13:34:02 +0000 |
---|---|---|
committer | Francis Ricci <francisjricci@gmail.com> | 2017-05-19 13:34:02 +0000 |
commit | 53f2f17bfb164310f560aa6f38665b4e994807f5 (patch) | |
tree | 9bd301bc527aab09947abf5ce50c44f71eb7458e /lib/lsan | |
parent | a0acb10461b015a3d1b8483f2d498f24479314c5 (diff) |
Use write instead of read permissions to check for global sections on mac
Summary:
The LINKEDIT section is very large and is read-only. Scanning this
section caused LSan on darwin to be very slow. When only writable sections
are scanned for global pointers, performance improved by a factor of about 25x.
Reviewers: alekseyshl, kubamracek
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33322
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@303422 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/lsan')
-rw-r--r-- | lib/lsan/lsan_common_mac.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/lsan/lsan_common_mac.cc b/lib/lsan/lsan_common_mac.cc index 5ee1e2286..ae1095543 100644 --- a/lib/lsan/lsan_common_mac.cc +++ b/lib/lsan/lsan_common_mac.cc @@ -110,7 +110,8 @@ void ProcessGlobalRegions(Frontier *frontier) { for (const __sanitizer::LoadedModule::AddressRange &range : modules[i].ranges()) { - if (range.executable || !range.readable) continue; + // Sections storing global variables are writable and non-executable + if (range.executable || !range.writable) continue; ScanGlobalRange(range.beg, range.end, frontier); } |