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