blob: 97a88a5021e16e22a38b03b6260d4c0141fa559f [file] [log] [blame]
Sergey Matveev5e719a72013-06-03 11:21:34 +00001//===-- sanitizer/lsan_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// This file is a part of LeakSanitizer.
11//
12// Public interface header.
13//===----------------------------------------------------------------------===//
14#ifndef SANITIZER_LSAN_INTERFACE_H
15#define SANITIZER_LSAN_INTERFACE_H
16
17#include <sanitizer/common_interface_defs.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22 // Allocations made between calls to __lsan_disable() and __lsan_enable() will
23 // be treated as non-leaks. Disable/enable pairs can be nested.
24 void __lsan_disable();
25 void __lsan_enable();
Sergey Matveevcd571e02013-06-06 14:17:56 +000026 // The heap object into which p points will be treated as a non-leak.
27 void __lsan_ignore_object(const void *p);
Alexey Samsonov9fbfd962013-06-27 09:35:50 +000028 // The user may optionally provide this function to disallow leak checking
29 // for the program it is linked into. Note: this function may be called late,
30 // after all the global destructors.
31 int __lsan_is_turned_off();
Sergey Matveev5e719a72013-06-03 11:21:34 +000032#ifdef __cplusplus
33} // extern "C"
34
35namespace __lsan {
36class ScopedDisabler {
37 public:
38 ScopedDisabler() { __lsan_disable(); }
39 ~ScopedDisabler() { __lsan_enable(); }
40};
41} // namespace __lsan
42#endif
43
44#endif // SANITIZER_LSAN_INTERFACE_H