flags.inc 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //===-- 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. #ifndef SCUDO_FLAG
  9. #error "Define SCUDO_FLAG prior to including this file!"
  10. #endif
  11. SCUDO_FLAG(int, quarantine_size_kb, 0,
  12. "Size (in kilobytes) of quarantine used to delay the actual "
  13. "deallocation of chunks. Lower value may reduce memory usage but "
  14. "decrease the effectiveness of the mitigation.")
  15. SCUDO_FLAG(int, thread_local_quarantine_size_kb, 0,
  16. "Size (in kilobytes) of per-thread cache used to offload the global "
  17. "quarantine. Lower value may reduce memory usage but might increase "
  18. "the contention on the global quarantine.")
  19. SCUDO_FLAG(int, quarantine_max_chunk_size, 0,
  20. "Size (in bytes) up to which chunks will be quarantined (if lower "
  21. "than or equal to).")
  22. SCUDO_FLAG(bool, dealloc_type_mismatch, false,
  23. "Terminate on a type mismatch in allocation-deallocation functions, "
  24. "eg: malloc/delete, new/free, new/delete[], etc.")
  25. SCUDO_FLAG(bool, delete_size_mismatch, true,
  26. "Terminate on a size mismatch between a sized-delete and the actual "
  27. "size of a chunk (as provided to new/new[]).")
  28. SCUDO_FLAG(bool, zero_contents, false, "Zero chunk contents on allocation.")
  29. SCUDO_FLAG(bool, pattern_fill_contents, false,
  30. "Pattern fill chunk contents on allocation.")
  31. SCUDO_FLAG(bool, may_return_null, true,
  32. "Indicate whether the allocator should terminate instead of "
  33. "returning NULL in otherwise non-fatal error scenarios, eg: OOM, "
  34. "invalid allocation alignments, etc.")
  35. SCUDO_FLAG(int, release_to_os_interval_ms, SCUDO_ANDROID ? INT32_MIN : 5000,
  36. "Interval (in milliseconds) at which to attempt release of unused "
  37. "memory to the OS. Negative values disable the feature.")
  38. SCUDO_FLAG(int, hard_rss_limit_mb, 0,
  39. "Hard RSS Limit in Mb. If non-zero, once the limit is achieved, "
  40. "abort the process")
  41. SCUDO_FLAG(int, soft_rss_limit_mb, 0,
  42. "Soft RSS Limit in Mb. If non-zero, once the limit is reached, all "
  43. "subsequent calls will fail or return NULL until the RSS goes below "
  44. "the soft limit")
  45. SCUDO_FLAG(int, allocation_ring_buffer_size, 32768,
  46. "Entries to keep in the allocation ring buffer for scudo.")