Make sure to scan mmap'd memory regions for root pointers on OS X
authorFrancis Ricci <francisjricci@gmail.com>
Wed, 19 Apr 2017 21:11:08 +0000 (21:11 +0000)
committerFrancis Ricci <francisjricci@gmail.com>
Wed, 19 Apr 2017 21:11:08 +0000 (21:11 +0000)
commit9be010f0d0b218fc6959a042d22ecc63011403b8
treec4005aac1068e4101f11dae3c31451f140c18860
parenteb930609e8452ec8281f1f62fdb741396df46ed0
Make sure to scan mmap'd memory regions for root pointers on OS X

Summary:
In the general case, we only need to check for root regions inside
the memory map returned by procmaps. However, on Darwin,
we also need to check inside mmap'd regions, which aren't returned
in the list of modules we get from procmaps.

This patch refactors memory region scanning on darwin to reduce
code duplication with the kernel alloc once page scan.

Reviewers: kubamracek, alekseyshl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D32190

llvm-svn: 300760
compiler-rt/lib/lsan/lsan_common.cc
compiler-rt/lib/lsan/lsan_common.h
compiler-rt/lib/lsan/lsan_common_mac.cc