summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_common.h
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.h
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.h')
-rw-r--r--lib/sanitizer_common/sanitizer_common.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sanitizer_common/sanitizer_common.h b/lib/sanitizer_common/sanitizer_common.h
index bbe7aebf3..33e652e6c 100644
--- a/lib/sanitizer_common/sanitizer_common.h
+++ b/lib/sanitizer_common/sanitizer_common.h
@@ -717,7 +717,7 @@ class LoadedModule {
void set(const char *module_name, uptr base_address, ModuleArch arch,
u8 uuid[kModuleUUIDSize], bool instrumented);
void clear();
- void addAddressRange(uptr beg, uptr end, bool executable, bool readable);
+ void addAddressRange(uptr beg, uptr end, bool executable, bool writable);
bool containsAddress(uptr address) const;
const char *full_name() const { return full_name_; }
@@ -732,14 +732,14 @@ class LoadedModule {
uptr beg;
uptr end;
bool executable;
- bool readable;
+ bool writable;
- AddressRange(uptr beg, uptr end, bool executable, bool readable)
+ AddressRange(uptr beg, uptr end, bool executable, bool writable)
: next(nullptr),
beg(beg),
end(end),
executable(executable),
- readable(readable) {}
+ writable(writable) {}
};
const IntrusiveList<AddressRange> &ranges() const { return ranges_; }