scudo_interface.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //===-- sanitizer/scudo_interface.h -----------------------------*- 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. /// Public Scudo interface header.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #ifndef SANITIZER_SCUDO_INTERFACE_H_
  13. #define SANITIZER_SCUDO_INTERFACE_H_
  14. #include <sanitizer/common_interface_defs.h>
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. // This function may be optionally provided by a user and should return
  19. // a string containing Scudo runtime options. See scudo_flags.h for details.
  20. const char* __scudo_default_options(void);
  21. // This function allows to set the RSS limit at runtime. This can be either
  22. // the hard limit (HardLimit=1) or the soft limit (HardLimit=0). The limit
  23. // can be removed by setting LimitMb to 0. This function's parameters should
  24. // be fully trusted to avoid security mishaps.
  25. void __scudo_set_rss_limit(size_t LimitMb, int HardLimit);
  26. // This function outputs various allocator statistics for both the Primary
  27. // and Secondary allocators, including memory usage, number of allocations
  28. // and deallocations.
  29. void __scudo_print_stats(void);
  30. #ifdef __cplusplus
  31. } // extern "C"
  32. #endif
  33. #endif // SANITIZER_SCUDO_INTERFACE_H_