#ifndef BASE_DEBUG_LEAK_ANNOTATIONS_H_
#define BASE_DEBUG_LEAK_ANNOTATIONS_H_
#include "build/build_config.h"
#if defined(LEAK_SANITIZER)
#include <sanitizer/lsan_interface.h>
class ScopedLeakSanitizerDisabler {
public:
ScopedLeakSanitizerDisabler() { __lsan_disable(); }
ScopedLeakSanitizerDisabler(const ScopedLeakSanitizerDisabler&) = delete;
ScopedLeakSanitizerDisabler& operator=(const ScopedLeakSanitizerDisabler&) =
delete;
~ScopedLeakSanitizerDisabler() { __lsan_enable(); }
};
#define ANNOTATE_SCOPED_MEMORY_LEAK \
ScopedLeakSanitizerDisabler leak_sanitizer_disabler; \
static_cast<void>(0)
#define ANNOTATE_LEAKING_OBJECT_PTR(X) __lsan_ignore_object(X);
#else
#define ANNOTATE_SCOPED_MEMORY_LEAK ((void)0)
#define ANNOTATE_LEAKING_OBJECT_PTR(X) ((void)0)
#endif
#endif