[PATCH] D97726: [sanitizers] [windows] Use InternalMmapVector instead of silencing -Wframe-larger-than

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 15 10:59:30 PDT 2021


rnk added inline comments.


================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_win.cpp:643
   size_t num_modules = bytes_required / sizeof(HMODULE);
   for (size_t i = 0; i < num_modules; ++i) {
     HMODULE handle = hmodules[i];
----------------
This might be a micro-optimization, but InternalMmapVector is built on VirtualAlloc, which is expensive, and now it's being done three times in a loop over the DLLs in a process. That might matter for startup time. Can you hoist the vectors out of the loop? You'll have to pass in memory to GetPreferredBase, which leaks implementation details, but I think it's worth doing.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97726/new/

https://reviews.llvm.org/D97726



More information about the llvm-commits mailing list