summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/lsan/lsan_common.h
diff options
context:
space:
mode:
authorFrancis Ricci <francisjricci@gmail.com>2017-04-19 21:11:08 +0000
committerFrancis Ricci <francisjricci@gmail.com>2017-04-19 21:11:08 +0000
commit9be010f0d0b218fc6959a042d22ecc63011403b8 (patch)
treec4005aac1068e4101f11dae3c31451f140c18860 /compiler-rt/lib/lsan/lsan_common.h
parenteb930609e8452ec8281f1f62fdb741396df46ed0 (diff)
downloadbcm5719-llvm-9be010f0d0b218fc6959a042d22ecc63011403b8.tar.gz
bcm5719-llvm-9be010f0d0b218fc6959a042d22ecc63011403b8.zip
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
Diffstat (limited to 'compiler-rt/lib/lsan/lsan_common.h')
-rw-r--r--compiler-rt/lib/lsan/lsan_common.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler-rt/lib/lsan/lsan_common.h b/compiler-rt/lib/lsan/lsan_common.h
index 88d5f1ca77d..121b9c08298 100644
--- a/compiler-rt/lib/lsan/lsan_common.h
+++ b/compiler-rt/lib/lsan/lsan_common.h
@@ -118,6 +118,15 @@ typedef InternalMmapVector<uptr> Frontier;
void InitializePlatformSpecificModules();
void ProcessGlobalRegions(Frontier *frontier);
void ProcessPlatformSpecificAllocations(Frontier *frontier);
+
+struct RootRegion {
+ uptr begin;
+ uptr size;
+};
+
+InternalMmapVector<RootRegion> const *GetRootRegions();
+void ScanRootRegion(Frontier *frontier, RootRegion const &region,
+ uptr region_begin, uptr region_end, uptr prot);
// Run stoptheworld while holding any platform-specific locks.
void DoStopTheWorld(StopTheWorldCallback callback, void* argument);
OpenPOWER on IntegriCloud