// Detect runtime TCMalloc bypasses.
bool IsTcMallocBypassed() {
-#if defined(OS_LINUX) || defined(OS_CHROMEOS)
+#if defined(OS_LINUX)
// This should detect a TCMalloc bypass from Valgrind.
char* g_slice = getenv("G_SLICE");
if (g_slice && !strcmp(g_slice, "always-malloc"))
// The sanitizers' calloc dies on OOM instead of returning NULL.
// The wrapper function in base/process_util_linux.cc that is used when we
// compile without TCMalloc will just die on OOM instead of returning NULL.
-#if !defined(OS_WIN) && (defined(ADDRESS_SANITIZER) || \
- defined(MEMORY_SANITIZER) || defined(THREAD_SANITIZER) || \
- (defined(OS_LINUX) && defined(NO_TCMALLOC)))
+#if defined(ADDRESS_SANITIZER) || \
+ defined(MEMORY_SANITIZER) || \
+ defined(THREAD_SANITIZER) || \
+ (defined(OS_LINUX) && defined(NO_TCMALLOC))
return true;
#else
return false;
}
}
-#if (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(__x86_64__)
+#if defined(OS_LINUX) && defined(__x86_64__)
// Check if ptr1 and ptr2 are separated by less than size chars.
bool ArePointersToSameArea(void* ptr1, void* ptr2, size_t size) {
ptrdiff_t ptr_diff = reinterpret_cast<char*>(std::max(ptr1, ptr2)) -
EXPECT_FALSE(impossible_random_address);
}
-#endif // (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(__x86_64__)
+#endif // defined(OS_LINUX) && defined(__x86_64__)
} // namespace