diff options
author | Kostya Serebryany <kcc@google.com> | 2016-08-26 23:58:42 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2016-08-26 23:58:42 +0000 |
commit | 28c63a2f21c7729c8dbd52bc6f005f6c2e30087c (patch) | |
tree | 4ce82ea31edb4f1c79006386a1dabceb02174609 /lib/sanitizer_common/sanitizer_common.cc | |
parent | 7d07acfe2b4a31e38f2a250a0a6daef78f19d6bc (diff) |
[asan] first attempt at releasing free-d memory back to the system using madvise. Requires quite some tuning.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279887 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_common.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_common.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_common.cc b/lib/sanitizer_common/sanitizer_common.cc index 79fcbb118..de179be5f 100644 --- a/lib/sanitizer_common/sanitizer_common.cc +++ b/lib/sanitizer_common/sanitizer_common.cc @@ -157,6 +157,7 @@ bool ReadFileToBuffer(const char *file_name, char **buff, uptr *buff_size, } typedef bool UptrComparisonFunction(const uptr &a, const uptr &b); +typedef bool U32ComparisonFunction(const u32 &a, const u32 &b); template<class T> static inline bool CompareLess(const T &a, const T &b) { @@ -167,6 +168,10 @@ void SortArray(uptr *array, uptr size) { InternalSort<uptr*, UptrComparisonFunction>(&array, size, CompareLess); } +void SortArray(u32 *array, uptr size) { + InternalSort<u32*, U32ComparisonFunction>(&array, size, CompareLess); +} + const char *StripPathPrefix(const char *filepath, const char *strip_path_prefix) { if (!filepath) return nullptr; |