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