Skip to content

Commit

Permalink
Add weak implementation of the __lsan_is_turned_off in Leak Checker
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 707155040
Change-Id: I84b84a07289334cb172d8a00674f88396ada9df6
  • Loading branch information
Abseil Team authored and copybara-github committed Dec 17, 2024
1 parent 03c34a9 commit caec5f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions absl/debugging/leak_check.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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; }
Expand Down

0 comments on commit caec5f1

Please sign in to comment.