[PATCH] D32966: Avoid unnecessary calls to vm_region_recurse

Francis Ricci via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 9 07:23:44 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL302530: Avoid unnecessary calls to vm_region_recurse (authored by fjricci).

Changed prior to commit:
  https://reviews.llvm.org/D32966?vs=98165&id=98278#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D32966

Files:
  compiler-rt/trunk/lib/lsan/lsan_common_mac.cc


Index: compiler-rt/trunk/lib/lsan/lsan_common_mac.cc
===================================================================
--- compiler-rt/trunk/lib/lsan/lsan_common_mac.cc
+++ compiler-rt/trunk/lib/lsan/lsan_common_mac.cc
@@ -144,6 +144,11 @@
     if (info.user_tag == VM_MEMORY_OS_ALLOC_ONCE) {
       ScanRangeForPointers(address, end_address, frontier, "GLOBAL",
                            kReachable);
+
+      // Recursing over the full memory map is very slow, break out
+      // early if we don't need the full iteration.
+      if (!flags()->use_root_regions || !root_regions->size())
+        break;
     }
 
     // This additional root region scan is required on Darwin in order to


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32966.98278.patch
Type: text/x-patch
Size: 694 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170509/13255186/attachment.bin>


More information about the llvm-commits mailing list