scudo_flags.inc 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #ifndef SCUDO_FLAG
  13. # error "Define SCUDO_FLAG prior to including this file!"
  14. #endif
  15. SCUDO_FLAG(int, QuarantineSizeMb, -1,
  16. "Deprecated. Please use QuarantineSizeKb.")
  17. // Default value is set in scudo_flags.cpp based on architecture.
  18. SCUDO_FLAG(int, QuarantineSizeKb, -1,
  19. "Size in KB of quarantine used to delay the actual deallocation of "
  20. "chunks. Lower value may reduce memory usage but decrease the "
  21. "effectiveness of the mitigation. Defaults to 64KB (32-bit) or "
  22. "256KB (64-bit)")
  23. // Default value is set in scudo_flags.cpp based on architecture.
  24. SCUDO_FLAG(int, ThreadLocalQuarantineSizeKb, -1,
  25. "Size in KB of per-thread cache used to offload the global "
  26. "quarantine. Lower value may reduce memory usage but might increase "
  27. "the contention on the global quarantine. Defaults to 16KB (32-bit) "
  28. "or 64KB (64-bit)")
  29. // Default value is set in scudo_flags.cpp based on architecture.
  30. SCUDO_FLAG(int, QuarantineChunksUpToSize, -1,
  31. "Size in bytes up to which chunks will be quarantined (if lower than"
  32. "or equal to). Defaults to 256 (32-bit) or 2048 (64-bit)")
  33. // Disable the deallocation type check by default on Android, it causes too many
  34. // issues with third party libraries.
  35. SCUDO_FLAG(bool, DeallocationTypeMismatch, !SANITIZER_ANDROID,
  36. "Report errors on malloc/delete, new/free, new/delete[], etc.")
  37. SCUDO_FLAG(bool, DeleteSizeMismatch, true,
  38. "Report errors on mismatch between size of new and delete.")
  39. SCUDO_FLAG(bool, ZeroContents, false,
  40. "Zero chunk contents on allocation and deallocation.")