Revert "Ignore current_instance heap allocation when leak sanitizer is enabled"

This reverts commit 70a35422b5.
This commit is contained in:
Aliaksey Kandratsenka 2017-09-23 14:55:33 -07:00
parent fb5987d579
commit ac072a3fc7
2 changed files with 0 additions and 16 deletions

View File

@ -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).

View File

@ -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())