Revert "Ignore current_instance heap allocation when leak sanitizer is enabled"
This reverts commit 70a35422b5
.
This commit is contained in:
parent
fb5987d579
commit
ac072a3fc7
|
@ -79,9 +79,6 @@ TCMALLOC_FLAGS =
|
|||
if MINGW
|
||||
TCMALLOC_FLAGS += -Wl,-u__tcmalloc
|
||||
endif MINGW
|
||||
if OSX
|
||||
AM_LDFLAGS += -Wl,-U,___lsan_ignore_object
|
||||
endif OSX
|
||||
|
||||
# If we have objcopy, make malloc/free/etc weak symbols. That way folks
|
||||
# can override our malloc if they want to (they can still use tc_malloc).
|
||||
|
|
|
@ -205,16 +205,6 @@ void MallocExtension::MarkThreadTemporarilyIdle() {
|
|||
|
||||
static MallocExtension* current_instance;
|
||||
|
||||
#if (!defined(_WIN32) && !defined(__MINGW32__))
|
||||
// Provide a weak hook for __lsan_ignore_object, so that
|
||||
// if leak sanitizer is enabled, we can ignore the current_instance
|
||||
// heap allocation.
|
||||
extern "C" void __attribute__((weak)) __lsan_ignore_object(const void *);
|
||||
#else
|
||||
// Weak hooks aren't supported on windows, but neither is leak sanitizer.
|
||||
void (*__lsan_ignore_object)(const void *) = nullptr;
|
||||
#endif
|
||||
|
||||
static void InitModule() {
|
||||
if (current_instance != NULL) {
|
||||
return;
|
||||
|
@ -223,9 +213,6 @@ static void InitModule() {
|
|||
#ifndef NO_HEAP_CHECK
|
||||
HeapLeakChecker::IgnoreObject(current_instance);
|
||||
#endif
|
||||
if (__lsan_ignore_object) {
|
||||
__lsan_ignore_object(current_instance);
|
||||
}
|
||||
}
|
||||
|
||||
REGISTER_MODULE_INITIALIZER(malloc_extension_init, InitModule())
|
||||
|
|
Loading…
Reference in New Issue