xref: /freebsd/contrib/llvm-project/compiler-rt/include/sanitizer/scudo_interface.h (revision 5f757f3ff9144b609b3c433dfd370cc6bdc191ad)
10b57cec5SDimitry Andric //===-- sanitizer/scudo_interface.h -----------------------------*- C++ -*-===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric //
90b57cec5SDimitry Andric /// Public Scudo interface header.
100b57cec5SDimitry Andric //
110b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
120b57cec5SDimitry Andric #ifndef SANITIZER_SCUDO_INTERFACE_H_
130b57cec5SDimitry Andric #define SANITIZER_SCUDO_INTERFACE_H_
140b57cec5SDimitry Andric 
150b57cec5SDimitry Andric #include <sanitizer/common_interface_defs.h>
160b57cec5SDimitry Andric 
170b57cec5SDimitry Andric #ifdef __cplusplus
180b57cec5SDimitry Andric extern "C" {
190b57cec5SDimitry Andric #endif
200b57cec5SDimitry Andric // This function may be optionally provided by a user and should return
210b57cec5SDimitry Andric // a string containing Scudo runtime options. See scudo_flags.h for details.
22*5f757f3fSDimitry Andric const char *SANITIZER_CDECL __scudo_default_options(void);
230b57cec5SDimitry Andric 
240b57cec5SDimitry Andric // This function allows to set the RSS limit at runtime. This can be either
250b57cec5SDimitry Andric // the hard limit (HardLimit=1) or the soft limit (HardLimit=0). The limit
260b57cec5SDimitry Andric // can be removed by setting LimitMb to 0. This function's parameters should
270b57cec5SDimitry Andric // be fully trusted to avoid security mishaps.
28*5f757f3fSDimitry Andric void SANITIZER_CDECL __scudo_set_rss_limit(size_t LimitMb, int HardLimit);
290b57cec5SDimitry Andric 
300b57cec5SDimitry Andric // This function outputs various allocator statistics for both the Primary
310b57cec5SDimitry Andric // and Secondary allocators, including memory usage, number of allocations
320b57cec5SDimitry Andric // and deallocations.
33*5f757f3fSDimitry Andric void SANITIZER_CDECL __scudo_print_stats(void);
340b57cec5SDimitry Andric #ifdef __cplusplus
350b57cec5SDimitry Andric } // extern "C"
360b57cec5SDimitry Andric #endif
370b57cec5SDimitry Andric 
380b57cec5SDimitry Andric #endif // SANITIZER_SCUDO_INTERFACE_H_
39