summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_common.cc
diff options
context:
space:
mode:
authorFrancis Ricci <francisjricci@gmail.com>2017-07-17 23:03:03 +0000
committerFrancis Ricci <francisjricci@gmail.com>2017-07-17 23:03:03 +0000
commit7e46d78d47832f03ce42adcf56417fbfd47cbaad (patch)
tree14cb9aaf563044e8836449365da05ff2f6fab21a /lib/sanitizer_common/sanitizer_common.cc
parent76862cd3ca43eb49946214b6263a22046a0033b2 (diff)
Only scan global sections containing data in LSan on darwin
Summary: __DATA segments on Darwin contain a large number of separate sections, most of which cannot actually contain pointers, and contain const values or objc metadata. Only scanning sections which can contain pointers greatly improves performance. On a medium-sized (~4000 files) internal project, I saw a speedup of about 50% in standalone LSan's execution time (50% improvement in the time spent running LSan, not the total program time). Reviewers: kcc, kubamracek, alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D35432 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308231 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_common.cc')
-rw-r--r--lib/sanitizer_common/sanitizer_common.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sanitizer_common/sanitizer_common.cc b/lib/sanitizer_common/sanitizer_common.cc
index 7e6f8fce7..3868d5469 100644
--- a/lib/sanitizer_common/sanitizer_common.cc
+++ b/lib/sanitizer_common/sanitizer_common.cc
@@ -285,9 +285,10 @@ void LoadedModule::clear() {
}
void LoadedModule::addAddressRange(uptr beg, uptr end, bool executable,
- bool writable) {
+ bool writable, const char *name) {
void *mem = InternalAlloc(sizeof(AddressRange));
- AddressRange *r = new(mem) AddressRange(beg, end, executable, writable);
+ AddressRange *r =
+ new(mem) AddressRange(beg, end, executable, writable, name);
ranges_.push_back(r);
if (executable && end > max_executable_address_)
max_executable_address_ = end;