From 2c44cbe210a9f88a50489446202c4cb5e974744e Mon Sep 17 00:00:00 2001 From: Evgeniy Stepanov Date: Fri, 14 Feb 2014 11:41:26 +0000 Subject: [sanitizer] Use mmap to zero-fill large shadow regions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is covered by existing ASan test. This does not change anything for TSan by default (but provides a flag to change the threshold size). Based on a patch by florent.bruneau here:   https://code.google.com/p/address-sanitizer/issues/detail?id=256 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201400 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/sanitizer_common/sanitizer_flags.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/sanitizer_common/sanitizer_flags.h') diff --git a/lib/sanitizer_common/sanitizer_flags.h b/lib/sanitizer_common/sanitizer_flags.h index a580acad8..dbd8f695a 100644 --- a/lib/sanitizer_common/sanitizer_flags.h +++ b/lib/sanitizer_common/sanitizer_flags.h @@ -20,6 +20,7 @@ namespace __sanitizer { void ParseFlag(const char *env, bool *flag, const char *name); void ParseFlag(const char *env, int *flag, const char *name); +void ParseFlag(const char *env, uptr *flag, const char *name); void ParseFlag(const char *env, const char **flag, const char *name); struct CommonFlags { @@ -70,6 +71,9 @@ struct CommonFlags { bool allow_user_segv_handler; // If set, uses alternate stack for signal handling. bool use_sigaltstack; + // Large shadow regions are zero-filled using mmap(NORESERVE) instead of + // memset. This is the threshold size in bytes. + uptr clear_shadow_mmap_threshold; }; inline CommonFlags *common_flags() { -- cgit v1.2.3