summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_common.cc
diff options
context:
space:
mode:
authorFrancis Ricci <francisjricci@gmail.com>2017-05-19 13:34:02 +0000
committerFrancis Ricci <francisjricci@gmail.com>2017-05-19 13:34:02 +0000
commit53f2f17bfb164310f560aa6f38665b4e994807f5 (patch)
tree9bd301bc527aab09947abf5ce50c44f71eb7458e /lib/sanitizer_common/sanitizer_common.cc
parenta0acb10461b015a3d1b8483f2d498f24479314c5 (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/sanitizer_common/sanitizer_common.cc')
-rw-r--r--lib/sanitizer_common/sanitizer_common.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sanitizer_common/sanitizer_common.cc b/lib/sanitizer_common/sanitizer_common.cc
index 471c3ded2..7e6f8fce7 100644
--- a/lib/sanitizer_common/sanitizer_common.cc
+++ b/lib/sanitizer_common/sanitizer_common.cc
@@ -285,9 +285,9 @@ void LoadedModule::clear() {
}
void LoadedModule::addAddressRange(uptr beg, uptr end, bool executable,
- bool readable) {
+ bool writable) {
void *mem = InternalAlloc(sizeof(AddressRange));
- AddressRange *r = new(mem) AddressRange(beg, end, executable, readable);
+ AddressRange *r = new(mem) AddressRange(beg, end, executable, writable);
ranges_.push_back(r);
if (executable && end > max_executable_address_)
max_executable_address_ = end;