Skip to content

Commit

Permalink
[asan] Remove unneeded VirtualQuery from exception handler
Browse files Browse the repository at this point in the history
We don't use the result of the query, and all tests pass if I remove it.
During startup, ASan spends a fair amount of time in this handler, and
the query is much more expensive than the call to commit the memory.

llvm-svn: 333595
  • Loading branch information
rnk committed May 30, 2018
1 parent 5b91350 commit b54ac41
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions compiler-rt/lib/asan/asan_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,6 @@ ShadowExceptionHandler(PEXCEPTION_POINTERS exception_pointers) {
// Determine the address of the page that is being accessed.
uptr page = RoundDownTo(addr, page_size);

// Query the existing page.
MEMORY_BASIC_INFORMATION mem_info = {};
if (::VirtualQuery((LPVOID)page, &mem_info, sizeof(mem_info)) == 0)
return EXCEPTION_CONTINUE_SEARCH;

// Commit the page.
uptr result =
(uptr)::VirtualAlloc((LPVOID)page, page_size, MEM_COMMIT, PAGE_READWRITE);
Expand Down

0 comments on commit b54ac41

Please sign in to comment.