blob: c826323359d1aa7fe16ab2b7255f0cce23242563 [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);
Sergey Matveev5e719a72013-06-03 11:21:34 +000028#ifdef __cplusplus
29} // extern "C"
30
31namespace __lsan {
32class ScopedDisabler {
33 public:
34 ScopedDisabler() { __lsan_disable(); }
35 ~ScopedDisabler() { __lsan_enable(); }
36};
37} // namespace __lsan
38#endif
39
40#endif // SANITIZER_LSAN_INTERFACE_H