1//===-- scudo_flags.inc -----------------------------------------*- C++ -*-===// 2// 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 6// 7//===----------------------------------------------------------------------===// 8/// 9/// Hardened Allocator runtime flags. 10/// 11//===----------------------------------------------------------------------===// 12 13#ifndef SCUDO_FLAG 14# error "Define SCUDO_FLAG prior to including this file!" 15#endif 16 17SCUDO_FLAG(int, QuarantineSizeMb, -1, 18 "Deprecated. Please use QuarantineSizeKb.") 19 20// Default value is set in scudo_flags.cpp based on architecture. 21SCUDO_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 " 25 "256KB (64-bit)") 26 27// Default value is set in scudo_flags.cpp based on architecture. 28SCUDO_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) " 32 "or 64KB (64-bit)") 33 34// Default value is set in scudo_flags.cpp based on architecture. 35SCUDO_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)") 38 39// Disable the deallocation type check by default on Android, it causes too many 40// issues with third party libraries. 41SCUDO_FLAG(bool, DeallocationTypeMismatch, !SANITIZER_ANDROID, 42 "Report errors on malloc/delete, new/free, new/delete[], etc.") 43 44SCUDO_FLAG(bool, DeleteSizeMismatch, true, 45 "Report errors on mismatch between size of new and delete.") 46 47SCUDO_FLAG(bool, ZeroContents, false, 48 "Zero chunk contents on allocation and deallocation.") 49