[Sanitizer] Rename InternalVector to InternalMmapVector
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@183972 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/lsan/lsan_common.cc b/lib/lsan/lsan_common.cc
index c686994..84d3152 100644
--- a/lib/lsan/lsan_common.cc
+++ b/lib/lsan/lsan_common.cc
@@ -87,7 +87,8 @@
// chunks (tag = kReachable or kIgnored) and finding indirectly leaked chunks
// (tag = kIndirectlyLeaked). In the second case, there's no flood fill,
// so frontier = 0.
-void ScanRangeForPointers(uptr begin, uptr end, InternalVector<uptr> *frontier,
+void ScanRangeForPointers(uptr begin, uptr end,
+ InternalMmapVector<uptr> *frontier,
const char *region_type, ChunkTag tag) {
const uptr alignment = flags()->pointer_alignment();
if (flags()->log_pointers)
@@ -116,7 +117,7 @@
// Scan thread data (stacks and TLS) for heap pointers.
static void ProcessThreads(SuspendedThreadsList const &suspended_threads,
- InternalVector<uptr> *frontier) {
+ InternalMmapVector<uptr> *frontier) {
InternalScopedBuffer<uptr> registers(SuspendedThreadsList::RegisterCount());
uptr registers_begin = reinterpret_cast<uptr>(registers.data());
uptr registers_end = registers_begin + registers.size();
@@ -183,7 +184,7 @@
}
}
-static void FloodFillTag(InternalVector<uptr> *frontier, ChunkTag tag) {
+static void FloodFillTag(InternalMmapVector<uptr> *frontier, ChunkTag tag) {
while (frontier->size()) {
uptr next_chunk = frontier->back();
frontier->pop_back();
@@ -214,7 +215,7 @@
// Set the appropriate tag on each chunk.
static void ClassifyAllChunks(SuspendedThreadsList const &suspended_threads) {
// Holds the flood fill frontier.
- InternalVector<uptr> frontier(GetPageSizeCached());
+ InternalMmapVector<uptr> frontier(GetPageSizeCached());
if (flags()->use_globals)
ProcessGlobalRegions(&frontier);
diff --git a/lib/lsan/lsan_common.h b/lib/lsan/lsan_common.h
index 9ac2946..09a72a1 100644
--- a/lib/lsan/lsan_common.h
+++ b/lib/lsan/lsan_common.h
@@ -77,7 +77,7 @@
void InitCommonLsan();
// Testing interface. Find leaked chunks and dump their addresses to vector.
-void ReportLeaked(InternalVector<void *> *leaked, uptr sources);
+void ReportLeaked(InternalMmapVector<void *> *leaked, uptr sources);
// Normal leak check. Find leaks and print a report according to flags.
void DoLeakCheck();
@@ -97,15 +97,16 @@
void PrintSummary();
bool IsEmpty() { return leaks_.size() == 0; }
private:
- InternalVector<Leak> leaks_;
+ InternalMmapVector<Leak> leaks_;
};
// Platform-specific functions.
void InitializePlatformSpecificModules();
-void ProcessGlobalRegions(InternalVector<uptr> *frontier);
-void ProcessPlatformSpecificAllocations(InternalVector<uptr> *frontier);
+void ProcessGlobalRegions(InternalMmapVector<uptr> *frontier);
+void ProcessPlatformSpecificAllocations(InternalMmapVector<uptr> *frontier);
-void ScanRangeForPointers(uptr begin, uptr end, InternalVector<uptr> *frontier,
+void ScanRangeForPointers(uptr begin, uptr end,
+ InternalMmapVector<uptr> *frontier,
const char *region_type, ChunkTag tag);
// Callables for iterating over chunks. Those classes are used as template
@@ -116,11 +117,12 @@
// as reachable and adds them to the frontier.
class ProcessPlatformSpecificAllocationsCb {
public:
- explicit ProcessPlatformSpecificAllocationsCb(InternalVector<uptr> *frontier)
+ explicit ProcessPlatformSpecificAllocationsCb(
+ InternalMmapVector<uptr> *frontier)
: frontier_(frontier) {}
void operator()(void *p) const;
private:
- InternalVector<uptr> *frontier_;
+ InternalMmapVector<uptr> *frontier_;
};
// Prints addresses of unreachable chunks.
@@ -149,11 +151,11 @@
// Finds all chunk marked as kIgnored and adds their addresses to frontier.
class CollectSuppressedCb {
public:
- explicit CollectSuppressedCb(InternalVector<uptr> *frontier)
+ explicit CollectSuppressedCb(InternalMmapVector<uptr> *frontier)
: frontier_(frontier) {}
void operator()(void *p) const;
private:
- InternalVector<uptr> *frontier_;
+ InternalMmapVector<uptr> *frontier_;
};
enum IgnoreObjectResult {
diff --git a/lib/lsan/lsan_common_linux.cc b/lib/lsan/lsan_common_linux.cc
index 9570810..087ea3e 100644
--- a/lib/lsan/lsan_common_linux.cc
+++ b/lib/lsan/lsan_common_linux.cc
@@ -53,8 +53,8 @@
static int ProcessGlobalRegionsCallback(struct dl_phdr_info *info, size_t size,
void *data) {
- InternalVector<uptr> *frontier =
- reinterpret_cast<InternalVector<uptr> *>(data);
+ InternalMmapVector<uptr> *frontier =
+ reinterpret_cast<InternalMmapVector<uptr> *>(data);
for (uptr j = 0; j < info->dlpi_phnum; j++) {
const ElfW(Phdr) *phdr = &(info->dlpi_phdr[j]);
// We're looking for .data and .bss sections, which reside in writeable,
@@ -83,7 +83,7 @@
}
// Scan global variables for heap pointers.
-void ProcessGlobalRegions(InternalVector<uptr> *frontier) {
+void ProcessGlobalRegions(InternalMmapVector<uptr> *frontier) {
// FIXME: dl_iterate_phdr acquires a linker lock, so we run a risk of
// deadlocking by running this under StopTheWorld. However, the lock is
// reentrant, so we should be able to fix this by acquiring the lock before
@@ -114,7 +114,7 @@
// Handle dynamically allocated TLS blocks by treating all chunks allocated from
// ld-linux.so as reachable.
-void ProcessPlatformSpecificAllocations(InternalVector<uptr> *frontier) {
+void ProcessPlatformSpecificAllocations(InternalMmapVector<uptr> *frontier) {
if (!flags()->use_tls) return;
if (!linker) return;
ForEachChunk(ProcessPlatformSpecificAllocationsCb(frontier));