2017-12-14 04:41:35 +08:00
|
|
|
//===-- sanitizer/scudo_interface.h -----------------------------*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2017-12-14 04:41:35 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
/// Public Scudo interface header.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef SANITIZER_SCUDO_INTERFACE_H_
|
|
|
|
#define SANITIZER_SCUDO_INTERFACE_H_
|
|
|
|
|
|
|
|
#include <sanitizer/common_interface_defs.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
// This function may be optionally provided by a user and should return
|
|
|
|
// a string containing Scudo runtime options. See scudo_flags.h for details.
|
2017-12-22 04:51:16 +08:00
|
|
|
const char* __scudo_default_options(void);
|
2017-12-14 04:41:35 +08:00
|
|
|
|
|
|
|
// This function allows to set the RSS limit at runtime. This can be either
|
|
|
|
// the hard limit (HardLimit=1) or the soft limit (HardLimit=0). The limit
|
|
|
|
// can be removed by setting LimitMb to 0. This function's parameters should
|
|
|
|
// be fully trusted to avoid security mishaps.
|
2018-01-05 01:05:04 +08:00
|
|
|
void __scudo_set_rss_limit(size_t LimitMb, int HardLimit);
|
2018-04-26 02:52:29 +08:00
|
|
|
|
|
|
|
// This function outputs various allocator statistics for both the Primary
|
|
|
|
// and Secondary allocators, including memory usage, number of allocations
|
|
|
|
// and deallocations.
|
|
|
|
void __scudo_print_stats(void);
|
2017-12-14 04:41:35 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
} // extern "C"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // SANITIZER_SCUDO_INTERFACE_H_
|