Speed up asan performance as well
Counting buffer indices is expensive on asan too.
Change-Id: I6b8a4f45087b27f42e724600de50a087472c0568
diff --git a/aos/events/simulated_event_loop.cc b/aos/events/simulated_event_loop.cc
index 9d431b7..8474bb8 100644
--- a/aos/events/simulated_event_loop.cc
+++ b/aos/events/simulated_event_loop.cc
@@ -154,9 +154,9 @@
}
void FreeBufferIndex(int i) {
- // This extra checking has a large performance hit with msan, so just skip
- // it.
-#if !__has_feature(memory_sanitizer)
+ // This extra checking has a large performance hit with sanitizers that
+ // track memory accesses, so just skip it.
+#if !__has_feature(memory_sanitizer) && !__has_feature(address_sanitizer)
DCHECK(std::find(available_buffer_indices_.begin(),
available_buffer_indices_.end(),
i) == available_buffer_indices_.end())