1 //===-- scudo_flags.inc -----------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 /// Hardened Allocator runtime flags.
11 //===----------------------------------------------------------------------===//
14 # error "Define SCUDO_FLAG prior to including this file!"
17 SCUDO_FLAG(int, QuarantineSizeMb, -1,
18 "Deprecated. Please use QuarantineSizeKb.")
20 // Default value is set in scudo_flags.cpp based on architecture.
21 SCUDO_FLAG(int, QuarantineSizeKb, -1,
22 "Size in KB of quarantine used to delay the actual deallocation of "
23 "chunks. Lower value may reduce memory usage but decrease the "
24 "effectiveness of the mitigation. Defaults to 64KB (32-bit) or "
27 // Default value is set in scudo_flags.cpp based on architecture.
28 SCUDO_FLAG(int, ThreadLocalQuarantineSizeKb, -1,
29 "Size in KB of per-thread cache used to offload the global "
30 "quarantine. Lower value may reduce memory usage but might increase "
31 "the contention on the global quarantine. Defaults to 16KB (32-bit) "
34 // Default value is set in scudo_flags.cpp based on architecture.
35 SCUDO_FLAG(int, QuarantineChunksUpToSize, -1,
36 "Size in bytes up to which chunks will be quarantined (if lower than"
37 "or equal to). Defaults to 256 (32-bit) or 2048 (64-bit)")
39 // Disable the deallocation type check by default on Android, it causes too many
40 // issues with third party libraries.
41 SCUDO_FLAG(bool, DeallocationTypeMismatch, !SANITIZER_ANDROID,
42 "Report errors on malloc/delete, new/free, new/delete[], etc.")
44 SCUDO_FLAG(bool, DeleteSizeMismatch, true,
45 "Report errors on mismatch between size of new and delete.")
47 SCUDO_FLAG(bool, ZeroContents, false,
48 "Zero chunk contents on allocation and deallocation.")