Merge "malloc_heapprofd: Avoid a spurious error log" am: 456eed0638

Original change: https://android-review.googlesource.com/c/platform/bionic/+/1846387

Change-Id: I84faefcf72613f67c6270921e948e95fde38fc1e
This commit is contained in:
Daniele Di Proietto 2021-10-11 10:37:42 +00:00 committed by Automerger Merge Worker
commit cdeddf033b

View file

@ -273,6 +273,11 @@ void HandleHeapprofdSignal() {
atomic_store(&gPreviousDefaultDispatchTable, nullptr);
gEphemeralDispatch = *NativeAllocatorDispatch();
}
} else if (expected == kEphemeralHookInstalled) {
// Nothing to do here. The ephemeral hook was installed, but
// MallocInitHeapprofdHook() was never called. Since the ephemeral hook
// is already there, no need to reinstall it.
return;
} else if (atomic_compare_exchange_strong(&gHeapprofdState, &expected2,
kInstallingEphemeralHook)) {
// if we still have hook installed, we can reuse the previous