summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan/asan_win.cc
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2012-03-10 01:30:01 +0000
committerKostya Serebryany <kcc@google.com>2012-03-10 01:30:01 +0000
commitb0f9354168529af874dc52b4196456bd74869594 (patch)
tree28e1da4723010ea60972447afca14553199b2c37 /compiler-rt/lib/asan/asan_win.cc
parente23d854c0517b06aae61bfd07e58955ee7adbe51 (diff)
downloadbcm5719-llvm-b0f9354168529af874dc52b4196456bd74869594.tar.gz
bcm5719-llvm-b0f9354168529af874dc52b4196456bd74869594.zip
[asan] use O(log(N)) algorithm instead of O(N) in __asan_get_ownership
llvm-svn: 152467
Diffstat (limited to 'compiler-rt/lib/asan/asan_win.cc')
-rw-r--r--compiler-rt/lib/asan/asan_win.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler-rt/lib/asan/asan_win.cc b/compiler-rt/lib/asan/asan_win.cc
index d47ff08e9e0..5df110330b6 100644
--- a/compiler-rt/lib/asan/asan_win.cc
+++ b/compiler-rt/lib/asan/asan_win.cc
@@ -26,6 +26,10 @@
#include "asan_procmaps.h"
#include "asan_thread.h"
+// Should not add dependency on libstdc++,
+// since most of the stuff here is inlinable.
+#include <algorithm>
+
namespace __asan {
// ---------------------- Memory management ---------------- {{{1
@@ -267,6 +271,10 @@ int Atexit(void (*function)(void)) {
return atexit(function);
}
+void SortArray(uintptr_t *array, size_t size) {
+ std::sort(array, array + size);
+}
+
} // namespace __asan
#endif // _WIN32
OpenPOWER on IntegriCloud