mirror of
https://github.com/abseil/abseil-cpp.git
synced 2026-06-04 12:07:05 +08:00
Add weak implementation of the __lsan_is_turned_off in Leak Checker
PiperOrigin-RevId: 707155040 Change-Id: I84b84a07289334cb172d8a00674f88396ada9df6
This commit is contained in:
committed by
Copybara-Service
parent
03c34a9eea
commit
caec5f1ca5
@@ -28,7 +28,7 @@
|
||||
#include <sanitizer/lsan_interface.h>
|
||||
|
||||
#if ABSL_HAVE_ATTRIBUTE_WEAK
|
||||
extern "C" ABSL_ATTRIBUTE_WEAK int __lsan_is_turned_off();
|
||||
extern "C" ABSL_ATTRIBUTE_WEAK int __lsan_is_turned_off() { return 0; }
|
||||
#endif
|
||||
|
||||
namespace absl {
|
||||
@@ -37,7 +37,7 @@ bool HaveLeakSanitizer() { return true; }
|
||||
|
||||
#if ABSL_HAVE_ATTRIBUTE_WEAK
|
||||
bool LeakCheckerIsActive() {
|
||||
return !(&__lsan_is_turned_off && __lsan_is_turned_off());
|
||||
return __lsan_is_turned_off() == 0;
|
||||
}
|
||||
#else
|
||||
bool LeakCheckerIsActive() { return true; }
|
||||
|
||||
Reference in New Issue
Block a user