blob: 2e0f06ae02629cccd441d558c05f67d61c0a3708 [file] [log] [blame]
From: Hidehiko Abe <hidehiko@chromium.org>
Date: Thu, 22 Nov 2018 01:59:18 +0900
Subject: [PATCH] libchrome: Disable memory allocator in asan builds.
Memory allocator in //base/allocator should not be used
with address sanitizer. Otherwise, it breaks asan builds since
many memory allocations will go to the base allocator instead
of asan.
BUG=chromium:807685
TEST=Build.
---
base/allocator/allocator_shim_override_cpp_symbols.h | 2 ++
base/allocator/allocator_shim_override_libc_symbols.h | 2 ++
2 files changed, 4 insertions(+)
diff --git a/base/allocator/allocator_shim_override_cpp_symbols.h b/base/allocator/allocator_shim_override_cpp_symbols.h
index 3313687..9f57025 100644
--- a/base/allocator/allocator_shim_override_cpp_symbols.h
+++ b/base/allocator/allocator_shim_override_cpp_symbols.h
@@ -15,6 +15,7 @@
#include "base/allocator/allocator_shim_internals.h"
+#if 0
SHIM_ALWAYS_EXPORT void* operator new(size_t size) {
return ShimCppNew(size);
}
@@ -49,3 +50,4 @@ SHIM_ALWAYS_EXPORT void operator delete[](void* p,
const std::nothrow_t&) __THROW {
ShimCppDelete(p);
}
+#endif
diff --git a/base/allocator/allocator_shim_override_libc_symbols.h b/base/allocator/allocator_shim_override_libc_symbols.h
index b77cbb1..c501c23 100644
--- a/base/allocator/allocator_shim_override_libc_symbols.h
+++ b/base/allocator/allocator_shim_override_libc_symbols.h
@@ -14,6 +14,7 @@
#include "base/allocator/allocator_shim_internals.h"
+#if 0
extern "C" {
SHIM_ALWAYS_EXPORT void* malloc(size_t size) __THROW {
@@ -61,3 +62,4 @@ SHIM_ALWAYS_EXPORT int posix_memalign(void** r, size_t a, size_t s) __THROW {
// size_t malloc_usable_size(const void*);
} // extern "C"
+#endif