#include <folly/memory/SanitizeLeak.h>
#include <mutex>
#include <numeric>
#include <shared_mutex>
#include <unordered_map>
#include <folly/lang/Extern.h>
extern "C" void __lsan_ignore_object(void const*);
extern "C" void __lsan_register_root_region(void const*, std::size_t);
extern "C" void __lsan_unregister_root_region(void const*, std::size_t);
namespace …
namespace folly {
namespace detail {
FOLLY_STORAGE_CONSTEXPR lsan_ignore_object_t* const
lsan_ignore_object_v = …;
FOLLY_STORAGE_CONSTEXPR lsan_register_root_region_t* const
lsan_register_root_region_v = …;
FOLLY_STORAGE_CONSTEXPR lsan_unregister_root_region_t* const
lsan_unregister_root_region_v = …;
namespace {
struct fake_mutex { … };
#if __cpp_lib_shared_mutex >= 201505L
mutex_type;
#else
using mutex_type = fake_mutex;
#endif
struct LeakedPtrs { … };
}
void annotate_object_leaked_impl(void const* ptr) { … }
void annotate_object_collected_impl(void const* ptr) { … }
size_t annotate_object_count_leaked_uncollected_impl() { … }
}
}