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