From a21db44b446dc6e7db373e6cc4c57c9cdbd768c9 Mon Sep 17 00:00:00 2001 From: Alex Shlyapnikov Date: Mon, 23 Oct 2017 17:12:07 +0000 Subject: [Sanitizers] New sanitizer API to purge allocator quarantine. Summary: Purging allocator quarantine and returning memory to OS might be desired between fuzzer iterations since, most likely, the quarantine is not going to catch bugs in the code under fuzz, but reducing RSS might significantly prolong the fuzzing session. Reviewers: cryptoad Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D39153 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316347 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/sanitizer/allocator_interface.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/sanitizer/allocator_interface.h b/include/sanitizer/allocator_interface.h index 522063161..2d35804b3 100644 --- a/include/sanitizer/allocator_interface.h +++ b/include/sanitizer/allocator_interface.h @@ -76,6 +76,13 @@ extern "C" { void (*malloc_hook)(const volatile void *, size_t), void (*free_hook)(const volatile void *)); + /* Drains allocator quarantines (calling thread's and global ones), returns + freed memory back to OS and releases other non-essential internal allocator + resources in attempt to reduce process RSS. + Currently available with ASan only. + */ + void __sanitizer_purge_allocator(); + #ifdef __cplusplus } // extern "C" #endif -- cgit v1.2.3