diff options
author | Kostya Serebryany <kcc@google.com> | 2012-03-10 01:30:01 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2012-03-10 01:30:01 +0000 |
commit | 25c7178bf96d2316a3d9424b118d04bc51be1a9b (patch) | |
tree | 6a226ae2e8dfd56f0137ece5cbb508b6b3dc1a3b /lib/asan/asan_posix.cc | |
parent | d364f87f81fda55d68a9e968bd314541c4272cde (diff) |
[asan] use O(log(N)) algorithm instead of O(N) in __asan_get_ownership
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@152467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_posix.cc')
-rw-r--r-- | lib/asan/asan_posix.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/asan/asan_posix.cc b/lib/asan/asan_posix.cc index 43a5ffee0..cc7a12825 100644 --- a/lib/asan/asan_posix.cc +++ b/lib/asan/asan_posix.cc @@ -30,6 +30,10 @@ #include <sys/atomics.h> #endif +// Should not add dependency on libstdc++, +// since most of the stuff here is inlinable. +#include <algorithm> + namespace __asan { static void MaybeInstallSigaction(int signum, @@ -112,6 +116,10 @@ int AtomicInc(int *a) { #endif } +void SortArray(uintptr_t *array, size_t size) { + std::sort(array, array + size); +} + // ---------------------- TSD ---------------- {{{1 static pthread_key_t tsd_key; |